$ printf 'Ankur\n30\n' | java src/ReadLn.java Your name? Your age? Hello Ankur, 30 is a good age to learn Java. no newline after this, newline after this $ java src/IoInAnyClass.java IO.println works in a normal class with no import $ java src/StaticImportIO.java (import static java.lang.IO.* makes the bare form work) println without the IO. prefix, after import static java.lang.IO.* $ java broken/NoIoPrefix.java (JDK 27: same error as on 25) broken/NoIoPrefix.java:2: error: cannot find symbol println("hello"); ^ symbol: method println(String) location: class NoIoPrefix 1 error error: compilation failed $ printf '' | java src/ReadLn.java (stdin closed: what does readln return?) Your name? Your age? Hello null, null is a good age to learn Java. no newline after this, newline after this