Javatpoint Logo
Javatpoint Logo

Java System setIn() Method

The setIn() method of Java System class is used to reassign the "standard" input stream.

Syntax

Parameter

in - It is the new standard input stream.

Exception

SecurityException: This exception will throw if the security manager exists and its checkPermission method doesn't allow reassigning of the standard input stream.

Example

Test it Now

Output:

file exist = true
OK

Next TopicJava System




Help Others, Please Share

facebook twitter pinterest