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

Comments

Popular posts from this blog

Develop an Android application to display “Hello World!” on screen

Program to design an applet which draws a circle (having color BLUE) inside a triangle (having color YELLOW)

Build a Simple Android App to Display Student Details