JPL - Expt No.10 - Minor Manual
JPL - Expt No.10 - Minor Manual
Experiment No. 10
Aim : Write a Java Program to demonstrate user defined packages in java .
Software used : jdk 1.6.0
Theory :
➢ A package as the name suggests is a pack(group) of classes, interfaces and other
packages.
➢ There are many built-in packages such as java, lang, awt, javax, swing, net, io, util, sql
etc.
for example when we need user input, we import a package like this:
import java.util.Scanner
Here,
→ java is a top level package
→ util is a sub package
→ and Scanner is a class which is present in the sub package util.
➢ User-defined java package program can be executed by using fully qualified name.
i.e. We need to specify the actual package name given to the created package to excecute
program, as shown in following syntax.
e.g. Package Name.class name