java what is name code example
Example: java what is name
public class Main {
public static void main(String[] args) {
var scanner = new java.util.Scanner(System.in);
System.out.print("What is your name? ");
var name = scanner.nextLine();
System.out.println("Hello " + name + "!"):
}
}