java.lang package Introduction

A package is a collection of predefined classes and interfaces, generally, having some common functionality (purpose). A package of Java is equivalent to a header file of C/C++. All the packages put together, that comes with JDK software, are known as Java API. The most important package of Java API is java.lang because without it no Java program with some functionality cannot be developed; it may be an application or applet. As this package is inevitable for each and every Java program you write, the package is implicitly imported if the Programmer does not import himself; this automatic importing facility exist only for java.lang package and not for other packages. java.lang package is the basic package required for each program. java.lang package contains all the minimum predefined classes required for every Java class we write.

This tutorial covers the important classes of java.lang package. The classes include Object, String, Math, System, Thread, Exception and wrapper classes like Integer, Double etc. Some classes like String, Exception and Thread, due to their importance, are discussed in separate topics. Like these classes, nearly as of JDK 1.5, the java.lang package includes 85 classes and interfaces etc. Every version of JDK adds something new.

View All java.lang Examples

Pass your comments and suggestions to improve the quality of this tutorial "java.lang package".

Leave a Comment

Your email address will not be published.