Why we do not import a package while we use any string function?

Java 8Object Oriented ProgrammingProgramming

The String class belongs to the java.lang package. This is the default package of the Java language therefore it is not mandatory to import it to use its classes.

Updated on 30-Jul-2019 22:30:21