instantiate : Java Glossary


The keyword new will allocate some RAM (Random Access Memory) and create a new object for you and initialise all its fields to zeros/nulls. The code in the various constructors then initialises the fields. This process of creating an object is called instantiation. When a method starts executing, all the local/temporary variables for that entire method (all embedded blocks too) are allocated slots on the stack. It does not wait until you actually enter a block. These local variables are not automatically initialised. Though the process is similar, the allocation of ram space for local variables is not usually referred to as instantiation. Methods other than constructors may return a newly minted object. The creation with new inside such a method is called instantiation, but you would not normally say that the method as a whole instantiated an object.

This page is posted
on the web at:

Optional Replicator mirror
on local hard disk J:

Please the feedback from other visitors, or your own feedback about the site.
Contact Roedy. Please feel free to link to this page without explicit permission.

Your face IP:[]
You are visitor number