
case, the static data is constant, so the client is unable to change it. For the
client, directly accessing the class constant is easier and faster than calling a
method.
3.12 Using System.in and System.out
In order to print program output to the screen, we have been using state-
ments like
System.out.println( “The value of b is “ + b );
and
System.out.print( “Enter your first name > “ );
And to instantiate a Scanner object, we used this statement:
Scanner scan = new Scanner( System.in );
It is now time to look at these statements in depth and understand them
completely.
System is an existing Java class in the java.lang package. One of its fields is a
static ...