fork download
  1. import java.util.Scanner;
  2.  
  3. public static void main(String[] args){
  4. Scanner input = new Scanner(System.in);
  5.  
  6. System.out.println("Please enter your name.");
  7.  
  8. String name = input.nextLine();
  9.  
  10. System.out.println("Nice to meet you, " + name);
  11. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:3: error: class, interface, or enum expected
public static void main(String[] args){
              ^
Main.java:6: error: class, interface, or enum expected
	System.out.println("Please enter your name.");
	^
Main.java:8: error: class, interface, or enum expected
	String name = input.nextLine();
	^
Main.java:10: error: class, interface, or enum expected
	System.out.println("Nice to meet you, " + name);
	^
Main.java:11: error: class, interface, or enum expected
}
^
5 errors
stdout
Standard output is empty