What is the difference between instantiation & initialization?

Showing Answers 1 - 12 of 12 Answers

Sridhar

  • Jun 11th, 2006
 

Instantiation is process of creating object. Initialization is process of initialising values inside that object.

  Was this answer useful?  Yes

lakshmi

  • Jun 27th, 2006
 

Instance ation will not allocate memory, just a instance will be created.

Initialization will actually allocate memory.

  Was this answer useful?  Yes

Mamata Jagati

  • Dec 17th, 2006
 

The reference variable is that one where we r not using the new keyword e.g. Connection con; But Object is that where we r using new operatore.g Classname cs1=new classname

  Was this answer useful?  Yes

Prithviraj

  • Nov 9th, 2014
 

Initialization-Assigning a value to a variable i.e a=0,setting the initial values.
Instantiation- Creating the object i.e when u r referencing a variable to an object with new operator.

Code
  1. int a;//Declaration

  2. a=10;//Initialization

  3. Integer int1=new Integer(5);// Instantiation where Integer is a class and int1 is reference variable

  4.  

  Was this answer useful?  Yes

Pankaj Sharma

  • Nov 17th, 2014
 

As below

Code
  1. Instantiation is a way to tell compiler you are going to create one instance of class as below:

  2.  

  3. Instantiation //

  4. Sample sam ;  // in case not final

  5.  

  6. Initialization  //

  7.  

  8. sam = new Sample();

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions