import java.util.Scanner;
//1124
public class CelebrityJeopardy {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
while(scanner.hasNext()) {
System.out.println(scanner.nextLine());
}
scanner.close();
}
}
what is problem with my code?? can you please tell me??
ReplyDeleteimport java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
System.out.println(sc.nextLine());
}
}
Nothing :) It runs fine. It's not showing anything because it's waiting for your input. If you run this app from command line, you will see that program starts and is waiting. Input some text to it, press enter and voila! This same string will appear on standard output.
Delete