JPR Manual Answers Experiment 10
JPR Manual Answers Experiment 10
10
Source Code:
For Packm(class in the package file)
package MyPack;
import MyPack.Packm;
class Mainpk
{
public static void main(String[] args)
{
Packm p=new Packm();
p.display();
}
}
Output:
Program Statement 2: Define a package named myInstitute include class named as
department with one method to display the staff of that department. Develop a program to
import this package in a java application and call the method defined in the package.
Source Code:
For department(class in the package file)
package myInstitute;
import myInstitute.Department;
Output:
Program Statement 3:Develop a program which consists of the package named
let_me_calculate with a class named Calculator and a method named add to add two integer
numbers. Import let_me_calculate package in another program(class named Demo) to add
two numbers.
Source Code:
For Calculator(class in the package file)
package let_me_calculate;
import let_me_calculate.Calculator;
Output: