• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Difference between instantiation and initialization objects

 
sureshreddy puli
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please tell me the difference between instantiation of an object and initialization of an object with simple example.
 
Kenneth Albertson
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi sureshreddy. You won't learn as much if I just tell you the answer. Instantiation is the creation of an instance, ie an object. Initialization is what it says, the setting of initial values. Have a look at the discussions of those two topics in the materials you are learning from. Then you can post your explanation and example, and someone will tell you if your answer is correct.
 
Naveen Vooka
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Instantiation: The mechanism whereby objects are created from a class description.
Example: http://www.cse.buffalo.edu/faculty/bina/java/java/sld015.htm

Initialization: This is the value assigned to a variable when it first defined.
Example: http://www.artima.com/designtechniques/initializationP.html
http://www.javaworld.com/javaworld/jw-11-2001/jw-1102-java101.html

--------------
Naveen Vooka
www.devsquare.com
DevSquare - Online Application Development
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic