Monday, 28 November 2016

Program to create a class 'Manager' to calculate the salary. Import the above package 'useFul' and make use of salary( ) method

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
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