jQuery in Action, 3rd edition
The moose likes Beginning Java and the fly likes Which phrase is right?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Which phrase is right??" Watch "Which phrase is right??" New topic

Which phrase is right??

srinivas koti

Joined: Jan 06, 2001
Posts: 9
Which is right?
"Instantiate a class" or "Instantiate an object"
Someone please clarify!
Rob Ross

Joined: Jan 07, 2002
Posts: 2205
Usually you talk about instantiating objects. You use the class as a template for constructing a new object.

Object myObject = new Object();

Can be read as:
instantiates an object of type "Object"
creates a new instance of class Object
creates a new object of type/class Object.
obtains the reference value returned from the instance creation expression 'new Object()' and stores it in the object reference variable 'myObject'.
But I think you'll be ok with the first 3!

SCJP 1.4
Sals Hamid

Joined: Jan 04, 2002
Posts: 24
we made instance of class e.g. we have class Salman we instantiate it by
Salman s = new Salman();
so s is the instance of class Salman
s is actually object. Class is not physical it just a boundary e.g An Architect made a map to build house, This map is class.There is no physical existance of class. We made house from class map, and this house is actually object which has physical existence

No Path of Flowers lead to glory
I agree. Here's the link: http://aspose.com/file-tools
subject: Which phrase is right??
It's not a secret anymore!