Jul 9, 2015

How to Create and Import Package In Java [Simple Program]

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
package packagename;
class classname
Syntax for Java Program
import package.*;
class classname extends classnameofpackage
main methode()
object creation
object calling


Post a Comment

Enter your email address: