• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Which phrase is right??

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which is right?
"Instantiate a class" or "Instantiate an object"
Someone please clarify!
Thx
 
Bartender
Posts: 2205
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
Rob
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic