java.lang package is available for every java program by default.
- Why?
Ans: The Java standard libraries include java.lang package by default, which contains a number of components that are used very commonly in Java programs. Java is useless without much of the functionality in java.lang, that's why java.lang is implicitly imported by the compiler for all programs.
How does it happen?
If I want to create such package which will auto import like java.lang package & will be available for every java program then how to do it?