This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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?
Kaydell Leavitt
Ranch Hand

Joined: Nov 18, 2006
Posts: 689

java.lang is the only package that is automatically included into each and every one of your java source-code files. The code that is in the java.lang package is the code that Sun believes is the most generally useful code.

Kaydell
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Adding to that, java.lang also contains a number of classes that have special language support, are integral to the VM implementation, or are "magic" in some other way. For example, java.lang.Object, the ultimate superclass of every other class, which has no superclass itself; java.lang.String, the only class with language support for literal values; Class and Classloader, without which no other classes can be brought into the JVM; StringBuffer/StringBuilder, which the compiler uses to implement the "+" operator for Strings; etc.


[Jess in Action][AskingGoodQuestions]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: important package