Computer Science, asked by samarthkrv, 1 day ago

String name;
System.out.println("What is your name?");
Scanner scanner = new Scanner(System.in);
name = scanner.next();
System.out.println(" Hello " + name);
What happens when executed?

Answers

Answered by iriyajul857
0

import java.util.Scanner;

public class Main {

public static void main(String[] args)

{

Scanner input = new Scanner (System.in);

System.out.print("Input your first name: ");

String fname = input.next();

System.out.print("Input your last name: ");

String lname = input.next();

System.out.println();

System.out.p

Similar questions