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


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

740 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements