aspose file tools*
The moose likes Beginning Java and the fly likes important package Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "important package" Watch "important package" New topic
Author

important package

pravanya Gullapudi
Greenhorn

Joined: May 07, 2007
Posts: 16
i know that java.lang is an important package. why it is important?
Alan Smithee
Greenhorn

Joined: Mar 21, 2006
Posts: 23
Originally posted by pravanya Gullapudi:
i know that java.lang is an important package. why it is important?


All classes directly or indirectly extend java.lang because java.lang is where the Object class resides. Since all java objects are ... well ... objects you need java.lang to be able to reference java.lang.object.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39425
    
  28
Not really. You are extending the Object class, not the java.lang package.

The java.lang package contains classes which are used all the time, including Object. It just so happens that in Java you don't have to import a class in the java.lang package, because the compiler looks for classes there anyway. Other languages don't have this feature; in C# for example you have to write something like "using System" at the beginning of every program to get at classes.

More about java.lang here in the API documentation.
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11419
    
  16

"Alan Smithee",

It has recently come to our attention that your screen name does not comply with our Naming Policy. Specifically, I refer to the "Obviously fictitious names may be locked out" part.

Please go here and edit your profile to comply.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: important package