PRASHNIKAप्रश्निका
‹ Back to the paper

Why is the `lang` package termed as the default package in Java?

Computer Science20252 marksShort answer

Answer

Answer

AI
The java.lang package is called the default package because it is imported automatically into every Java program by the compiler; unlike other packages, it does not need an explicit import statement to use the classes it provides (such as String, Math, Integer and the other wrapper classes).
Programming in Java (Review of Class XI Sections B and C)

From ISC Computer Science - Competency Focused Practice Questions (CISCE, August 2024), question 49.