• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

important package

 
pravanya Gullapudi
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i know that java.lang is an important package. why it is important?
 
Kaydell Leavitt
Ranch Hand
Posts: 689
Eclipse IDE Firefox Browser Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic