What will be the output of this code snippet?

Last Updated :
Discuss
Comments

What will be the output of this code snippet?

Java
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str = br.readLine();
System.out.println(str);


Compilation error

Prints nothing

Reads and prints one line of input

Throws IOException always

Share your thoughts in the comments