File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Newb Question... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Newb Question..." Watch "Newb Question..." New topic

Newb Question...

Scott Batchelor

Joined: Jul 07, 2003
Posts: 11
So a class is the same thing as an object?
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
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 ]

Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1873
"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...
Scott Batchelor

Joined: Jul 07, 2003
Posts: 11
Thanks... that is the clearest explanation I have had yet to date and I see the light.
Thanks Again.
It is sorta covered in the JavaRanch Style Guide.
subject: Newb Question...
It's not a secret anymore!