• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Newb Question...

 
Scott Batchelor
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So a class is the same thing as an object?
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Scott Batchelor:
So a class is the same thing as an object?

Nope. A class is a meta-object or pattern to create objects. Consider a class as you would a recipe. You have to combine the ingredients in the proper quantities and orders and then cook the results appropriately to create the objects (cookies?).
[ July 14, 2003: Message edited by: Michael Morris ]
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
also
"Person" is a class as it defines attributes a person can have like,
name, ssn, telephone number etc..
BUT "you" and "me" are "OBJECTS" of that Person class. so if somebody says that "a person should not insult another person" it doesn't point to any specific person but any person in general, right? BUT if we say- "maulin should not insult Scott" then it is meant for specific person instances maulin and scott which are objects.
class just says "which" information is there. object describes "what is the content" of that "which" information you know
Person class will say, it should have a name. Maulin object of that class says Person is maulin. Scott object of that class says, Scott is a person.
hope i didn't ditract you instead of helping...
regards
maulin
 
Scott Batchelor
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maulin,
Thanks... that is the clearest explanation I have had yet to date and I see the light.
Thanks Again.
Scott
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic