A Java package is a mechanism for organizing Java classes into single Module, providing modular programming in Java. Java packages can be stored in compressed files called JAR files, allowing classes to be downloaded faster as groups rather than individually. Programmers also typically use packages to organize classes belonging to the same category or providing similar functionality. A package provides a unique namespace for the types it contains. Classes in the same package can access each other's package-private and protected members.
Syntax of package
Syntax of package
package packagename;
class classname
{
methode()
{
statements
}
}
Syntax for Java Program
Also Read
import package.*;
class classname extends classnameofpackage
{
main methode()
{
object creation
object calling
}
}
0 comments:
Post a Comment