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
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
Chemistry,
29 days ago
English,
29 days ago
Math,
1 month ago
Physics,
1 month ago
Social Sciences,
10 months ago