Answer to Question #3542 in Java | JSP | JSF for Y mukundareddy

Question #3542
(1) Write a program to take your name as input and print it on console?
1
Expert's answer
2012-03-15T12:12:22-0400
import java.util.Scanner;

public class Greeting {
public static
void main(String[] args) {
System.out.print("Enter your name:
");
Scanner scanner = new Scanner(System.in);
String name
= scanner.nextLine();
System.out.println("You have entered: " +
name);
}

}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS