In this program we use the package useFul to import the class UseMe in another class Manager. Here we have used the salary( ) method of UseMe class to calculate the gross salary of manager.
PROGRAM
PROGRAM
import useFul.UseMe; class Manager { public static void main(String b[]) { UseMe u2 = new UseMe(); u2.salary(15000,2500,1500); } }OUTPUT
C:\>javac Manager.java C:\>java Manager Basic salary = 15000.0 DA = 2500.0 HRA = 1500.0 Gross Salary = 19000.0
No comments:
Post a comment