object in java object in java with example creating an object in java object definition in java with example
size of object in java data access object in java class object in java class and object in java
Object:
Whenever we define class no memory space is
created for data members and methods of class.
Memory space will be created for data members
and methods when we create object for particular class.
Data processing / Data accessing in class can be
done with the help of object.
Definitions:
Definition 1: Instance of class is known as Object.
(instance is nothing but allocationg
sufficient memory space for th data members and methods of class.)
Definition 2: Class variable is known as an object.
Definition
3: Value form of
class is known as an Object.
Definition 4: Blue print of class is known as Object.
Definition 5: The Logical run time entity is known as Object.
Creation Of Object:
In java programming creating an object
is nothing but allocating the memory space for data members and methods of
class.
To allocate memory for data members in
class by following dynamic memory allocation.
we use an operator called New.
we use an operator called New.
Even if we use New operator to an object
dynamically internally, new operator performs the following operations.
a) It allocates sufficient amount of
memory space for the data members of class.
b) It takes an address of loaded class
and place it into lhs variable(i.e: object name).
1) Directly Creation of Object
<class name> <object name> =new
<class name()>;
2) Declaration and then Creation of Object
<class name> <object name>;
Class And its Definitions
For More Details ......... Click Here
Object Oriented Programming Principles Are :
Object Oriented Programming Principles Are :
1) Class
2) Object
5) Inheritance
6) Polymorphism
No comments:
Post a Comment