aspose file tools*
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
Author

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 System.java file in jdk1.5.0_14\src\java\lang\System.java
It shows something like this

package java.lang;

import java.io.*;
import java.util.Properties;
import java.util.PropertyPermission;
import java.util.StringTokenizer;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.security.AllPermission;
import java.nio.channels.Channel;
import java.nio.channels.spi.SelectorProvider;
import sun.net.InetAddressCachePolicy;
import sun.nio.ch.Interruptible;
import sun.reflect.Reflection;
import sun.security.util.SecurityConstants;
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 ]

SCJP || SCWCD

Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14347
    
  22

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.
like
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
Sheriff

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
sscce.org
sachin verma
Ranch Hand

Joined: Mar 25, 2008
Posts: 177
 
 
subject: Is Sun Fooling US