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