0% found this document useful (0 votes)
3 views1 page

Java Class Structure for Employees

Uploaded by

hgcaptaincold
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

Java Class Structure for Employees

Uploaded by

hgcaptaincold
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

class Manager {

String name, address, jobTitle, remark;


double salary;
int team;

Manager(String n, String a, double s, String jt, String r, int t){


name=n; address=a; salary=s; jobTitle=jt; remark=r; team=t;
}

double bonus(){ return salary*0.05; }

void info(){
[Link](jobTitle+" "+name+" | "+address+" | ■"+salary+
" | Bonus: "+bonus()+" | "+remark+
" | Team: "+team);
}
}

class Developer {
String name, address, jobTitle, remark;
double salary;

Developer(String n, String a, double s, String jt, String r){


name=n; address=a; salary=s; jobTitle=jt; remark=r;
}

double bonus(){ return salary*0.05; }

void info(){
[Link](jobTitle+" "+name+" | "+address+" | ■"+salary+
" | Bonus: "+bonus()+" | "+remark);
}
}

class Programmer extends Developer {


Programmer(String n, String a, double s, String jt, String r){
super(n,a,s,jt,r);
}
}

public class Main {


public static void main(String[] args) {

Manager m = new Manager("Sneha","Pune",90000,"Manager","Excellent Leader",12);


Developer d = new Developer("Aarav","Delhi",55000,"Developer","Good Performer");
Programmer p = new Programmer("Rahul","Mumbai",70000,"Programmer","Expert Debugger");

[Link]();
[Link]();
[Link]();
}
}

You might also like