Page 12 - JAVA Programming
P. 12
11
Object
Object are basic rum time entities in object oriented system. May
represent a real-world entity such as a place, a bank account, a table
of data or any item than the program must handle.
Object are variables of class because it is create the class data types.
An object is an instance a class.
An Object has two general characteristics namely. State and
behaviour. An Object’s state represents what the object knows. The
state is maintained in one or more variables associated with the
object.
An Object behaviour represent what the object can do. The behaviour
is implemented be defined methods that the object can access. Simply
put, a method is named block of code that does something.
An Object has identity which differentiates one object from the other.
Other name is used to identity the object. Hence, name itself is an
identify the object. Hence, Name itself is an identity.
Objects are generally used to access members data (data and
methods) of class.
• For Example:
Person p = new person(). In this statement ‘p’ is an object of
person class.
Following Table compares Class and Object .
Sl. No Class Object
1. A class is a user defined data type. An Object is an instance of class data type.
2. Class generated Object. An Object gives life to a class.
3. It is the prototype or model. Object is a container for strong its feature.
4. Class does not occupy memory If occupies memory location.
location.
5. It Cannot be manipulated because Object can be manipulated.
it is not available in the memory.