Java System in
Syntax
System.in has the following syntax.
public static final InputStream in
Example
In the following code shows how to use System.in field.
//from w ww. ja va2 s . com
import java.io.IOException;
public class Main {
public static void main(String[] arg) {
System.out.println("Type something");
try {
System.in.read();
} catch (IOException e) {
e.printStackTrace();
}
}
}
The code above generates the following result.