Java includes the import statement to bring certain classes, or entire packages, into visibility. Once imported, a class can be referred to directly, using only its name… Read more »
Summary
- Package is a mechanism used for partitioning the class name space into more manageable chunks.
- Packages are containers for classes that are used to keep the class name space compartmentalized.
- To create a package, package command should be included as the first statement is a Java source file. i.e: package pkg ;
- The import statement is used to bring the packages into visibility i.e import pkg ;
- Interfaces are similar to classes, but lack instance variables.
- The methods in interfaces are declared without any body.
- Interfaces are designed to support dynamic method resolution at run time.