Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is instantiation in java ?

 
bharath pathikonda ramesh
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
plseas its very urgent
 
David Ulicny
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
creation of new object
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to Java In General (Beginner)...
 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Suppose u have a class...

class MyClass{
...
..

}

Somewhere you have a piece of code where u create a object of this class...


Myclass myObject=new MyClass();

This step creates an isntnace of the class...i.e. it instantiates an object of the class-MyClass..

Hope u ge the point..

Regards
 
BalajiS Sridharan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A class is basically a blueprint which u can use..., consider a class as a factory that will provide u with as many number of the blueprint as u need (which are called as objects)..., creating a object from a class is called instantiation.

U can instantiate a class by using the keyword new.
 
Steve Morrow
Ranch Hand
Posts: 657
Clojure Spring VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please make the extra effort to write out words such as "you". The extra keystrokes won't cost much in the way of time, and the enhanced clarity will be appreciated by those communicating on a forum with international readership.

http://faq.javaranch.com/view?UseRealWords
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic