xxxxxxxxxx
// import <package> -> Imports the whole package
// import <package>.<class> -> Imports a certain class
import java.util.Scanner;
xxxxxxxxxx
Package is a mechanism to group related classes ,interfaces and enums
in to a single module.
Package can be declared using the following statement :
Syntax : package <package-name>
Coding Convention : package name should be declared in small letters.
package statement defines the namespace.
The main use of package is
1) To resolve naming conflicts
2) For visibility control : We can define classes and interfaces that are
not accessible outside the class
xxxxxxxxxx
Do not use the default package for real applications.
It is perfectly fine for simple, educational applications,
like "Hello world", but more complex projects will be better in named packages.