Scanner name = new Scanner (System.in); String firstname; String secondname; System. out. println(“Enter your first name:”); firstname = name. next(); System.
Read moreHow do you display a string in Java?
The most basic way to display a string in a Java program is with the System. out. println() statement . This statement takes any strings and other variables inside the parentheses and displays them.
Read moreHow do you display a Java program?
Java Basic Input and Output
Read more