Aug 30, 2013

What is internal mechanism of Object creation code in java Programming

Internal Mechanism of Object creation code in java

Java:Internal mechanism of java object creating code in java-programming. Let us describe what is the main mechanism behind object creating code in java-programming. I am telling you what happens internally when an object gets created. 

If class name is My_class then object creation code will be-

My_class ob=new My_class();

We know that class is a reference data type in java. So "ob" is called as the reference variable of My_class. We know that assignment operator assigns some value from right hand side to left hand side. Here some value is being assigned to ob variable.
new operator is responsible for creating the object of the java program. We can not fetch address of the object so we assign reference of the object in a reference variable i.e."ob". Now we have the reference of object in "ob" variable by which we can access all non static variable of the My_class.


Here we are telling each term used in object creating code in java programming.