File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "object" Watch "object" New topic



Joined: Jul 27, 2000
Posts: 5
when i am going through java.lang pck,i saw the classes mentioned under this pck,i found that object is one class under this pck, but i also knew that object class is the superclass of all classes. how is this possible

catchbollu entered in
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13027
Whats the problem? Object is in the java.lang package,
and is the superobject of everything. so?
Rahul Mahindrakar
Ranch Hand

Joined: Jul 28, 2000
Posts: 1864
hi bollu,
The API has the specifications for all the classes. Object is a class in the end. It is also the superclass for all classes. The API must specify Objects constructor, methods, etc. This it does in the java.lang package which is available to all programes by default.
john shen

Joined: Jul 23, 2000
Posts: 14
i think the confusion is between package hierarchy and object hierarchy, which has little to do with each other, but the asker thought they are related.
there are questions on mocks that try to confuse you about them (e.g., what is the superclass of awt event classes? surely it is not in the java.awt!) therefore the confused feeling is legit, esp. when the java designers seem to be placing related classes randomly in unrelated packages. at least some of the time.
I agree. Here's the link:
subject: object
It's not a secret anymore!