Pages

Saturday, December 14, 2013

Java - Object

     An object is representing the real time object. For example, Car, pen, etc

It has two parts such as

  • State --------> Fields
  • Behavior --------> Methods
It is the instance of class

Syntax:

= new ;

Car c = new Car();

Here new----> memory operator.

Let us assume Car as the class.

Object------>realtime object such as wheel, steering, etc

Using Realtime object we can make some action is called as method...

Here brake is an object and applying brake is the method.



No comments:

Post a Comment