Java Commands
Java Commands
BASIC
Mr.C.Thiruvengadam
Associate Professor
Det. Of ECE
Anjalai Ammal Mahalingam Engineering College
Kovilvenni
class, object, methods, and instance
variables
When we consider a Java program, it can be defined as a collection of objects that
communicate via invoking each other's methods. Let us now briefly look into what
do class, object, methods, and instance variables mean.
Object - Objects have states and behaviors. Example: A dog has states - color,
name, breed as well as behavior such as wagging their tail, barking, eating. An
object is an instance of a class.
Instance Variables - Each object has its unique set of instance variables. An object's
state is created by the values assigned to these instance variables.
The above class contains the following methods:
public static String readString ()
o Reads and returns a string, to the end of the
line, from standard input.
public static String readWord ()
o Reads and returns one space-delimited word
from standard input.
public static boolean readBoolean ()
o Reads and returns a boolean value from
standard input. Returns false if an exception
occurs during the read.
The above class contains the following methods: