Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Object

 
dejie lin
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, all
I am quite blue about the type "object", what is it? anybody can give me some discription of it or examples?
thanks
 
krishnaraja Puranika
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ...
if u go thru thr books u will find this: an "object" is any real world entity that has some well defined behavior.. and so on..
In the similar way a "class" can be defined as the logical collection of similar objects.
Now lets go in a general way so that we can understand these definations.
Eg:if u consider the human beings as a class , then each person will become a object of that human class. hence the class will be a logical collection of similar objects..
Now the selection if classes and objects is a purely relative matter...it differs from person to person. One can define a all the Gents as a class and each man will be the object of that class..and so on..and depends on the perticular problem..
Now lets consider a application example: Lets say we need to keep track of all the employees of a perticular company...then we can make a class called Employee and employee1,employe2..and so on as objects of that class...
hope this helped u .....
thanx...bye
 
Marilyn de Queiroz
Sheriff
Posts: 9063
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Every "thing" is an Object. The class "Object" is a generic class that contains methods that are common to all java objects. Every java object inherits from (extends) Object even if it is not expressly written. For example, java.lang.String extends Object. So does any class that you write.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic