My Hindi Forum

Go Back   My Hindi Forum > Miscellaneous > Tech Talks
Home Rules Facebook Register FAQ Community

Reply
 
Thread Tools Display Modes
Old 25-01-2010, 02:10 PM   #1
sunita
Member
 
sunita's Avatar
 
Join Date: Dec 2009
Posts: 64
Rep Power: 15
sunita is on a distinguished road
Default What happens when an object is created in Java?

1. Memory is allocated from heap to hold all instance variables and implementation-specific data of the object and its superclasses. Implementation-specific data includes pointers to class and method data.
2. The instance variables of the objects are initialized to their default values.
3. The constructor for the most derived class is invoked. The first thing a constructor does is call the constructor for its uppercase. This process continues until the constructor for java.lang.Object is called, as java.lang.Object is the base class for all objects in java.
4. Before the body of the constructor is executed, all instance variable initializers and initialization blocks are executed. Then the body of the constructor is executed. Thus, the constructor for the base class completes first and constructor for the most derived class completes last.
sunita is offline   Reply With Quote
Old 26-01-2010, 06:24 AM   #2
javaguru
Member
 
javaguru's Avatar
 
Join Date: Dec 2009
Posts: 50
Rep Power: 15
javaguru is on a distinguished road
Default

really good one, thanks for the info.
javaguru is offline   Reply With Quote
Reply

Bookmarks

Tags
java object


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT +5. The time now is 07:54 PM.


Powered by: vBulletin
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
MyHindiForum.com is not responsible for the views and opinion of the posters. The posters and only posters shall be liable for any copyright infringement.