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 Is Sun Fooling US Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Is Sun Fooling US" Watch "Is Sun Fooling US" New topic

Is Sun Fooling US

sachin verma
Ranch Hand

Joined: Mar 25, 2008
Posts: 177
This is my first ever post in this forum so first I want to say Hi to all.

Now I have been using JAVA Documentation from a long time.
And because it was released from sun too, I did not expect any flaw in it.
But now I don't trust it at all.
Reason is
For instance when I see System class Documentation in jdk-1_5_0-doc\docs\api\java\lang\System.html
It shows that System is a final class and it is also a direst subclass of Object.
like the below->>>>>>>
public final class System
extends Object

But when I see file in jdk1.5.0_14\src\java\lang\
It shows something like this

package java.lang;

import java.util.Properties;
import java.util.PropertyPermission;
import java.util.StringTokenizer;
import java.nio.channels.Channel;
import java.nio.channels.spi.SelectorProvider;
import sun.reflect.Reflection;
import sun.reflect.annotation.AnnotationType;

public final class System {
//Specific code

My Question is "Why this Difference Exists ?"
And what is the purpose of Documentation then If it does not provide the correct n Exact information?

I am preparing for scjp 310-055
I have been using java from last 3 years.

[Removed non-words from subject line]
[ April 21, 2008: Message edited by: Ben Souther ]


Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15081

Difference? I don't see a difference.

As you see in the source code, class System is indeed final. You never need to extend class Object explicitly - classes that don't extend a superclass implicitly extend class Object.

So the information in the documentation is correct.

Also, please pay attention to the following: Here on JavaRanch, we have a naming policy. We want the users of JavaRanch to use a real-sounding name as their display name.

Your name "scjp sachin" is not a real name. So please change your name in accordance to the naming policy. You can change your name by editing your profile.

Please note that we are taking the naming policy seriously. If you do not change your display name, your account on JavaRanch might be locked.
[ April 21, 2008: Message edited by: Jesper Young ]

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
sachin verma
Ranch Hand

Joined: Mar 25, 2008
Posts: 177
Thanks for telling me the naming policies..I have changed it.

Are you trying to say that every class that we construct is implicitly a direct subclass of Object class (that is on the top).Or it provides us its infomation through hierarchy.
Object-->SomeClassesToSupportThreading-->SomeClassesToSupportException-->etc etc-->UserClass

If it provides through hierarchy then isn't it important then whenever someone uses the direct sub classing from Object...he/she should provide the exact way of using.
Does it matter to subclass direct from Object, Or through hierarchy ??
marc weber

Joined: Aug 31, 2004
Posts: 11343

Java has a singly rooted hierarchy, meaning that a single class (java.lang.Object) is at the top of the hierarchy for all objects.

As the JLS states under section 4.3.2, "The class Object is a superclass (�8.1) of all other classes."

"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sachin verma
Ranch Hand

Joined: Mar 25, 2008
Posts: 177
I agree. Here's the link:
subject: Is Sun Fooling US
It's not a secret anymore!