I’m trying to run this code:
public static void main (String [] args )
{
BufferedReader reader =
new BufferReader ();
String name = reader.readLine();
System.out.println(“Hello ”name);
}
But I’m getting an error.
CodePudding user response:
Please try to add the complete code for Buffered function, as this:
public static void main(String[] args) throws IOException
{
BufferedReader reader =
new BufferedReader(new InputStreamReader(System.in));
String name = reader.readLine();
System.out.println("Hello " name);
}