package employee;
public class Employee {
public static void main(String[] args) {
Employee em = new Employee(4567 , "Asmaa"){
public void calsal() {
};
System.out.println(em.getId());
System.out.println(em.getName);
em.calsal();
private void calsal() {
throw new UnsupportedOperationException("Not supported yet."); // Generated from
nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
public abstract class employee {
private int id;
private String name;
public employee() {
} public employee(int id, String name) {
this.id = id;
this.name = name;
}public int getId() {
return id;}
public void setId(int id) {
this.id = id;
public String getName() {
return name;
public void setName(String name) {
this.name = name;
public abstract void calsal();
// System.out.println("cal");
@Override
public String toString() {
return "employee{" + "id=" + id + ", name=" + name + '}';
}
public class partTime {
private int workingHours;
private double dinarPerHour;
public partTime() {
// super();
public partTime(int workingHours, double dinarPerHour) {
super();
this.workingHours = workingHours;
this.dinarPerHour = dinarPerHour;
public int getWorkingHours() {
return workingHours;
public void setWorkingHours(int workingHours) {
this.workingHours = workingHours;
}
public double getDinarPerHour() {
return dinarPerHour;
public void setDinarPerHour(double dinarPerHour) {
this.dinarPerHour = dinarPerHour;
public double calculateSalary(){
double salary;
return salary = dinarPerHour * workingHours;
public String toString() {
return "partTime{" + "workingHours=" + workingHours + ", dinarPerHour=" + dinarPerHour + '}';
public void calsal() {
public class FullTime {
private double salary;
public FullTime(){
}public FullTime(double salary) {
this.salary = salary;
public double getSalary() {
return salary;
public void setSalary(double salary) {
this.salary = salary;
public double calculateSalary(){
return salary ;
@Override
public String toString() {
return "FullTime{" + "salary=" + salary + '}';
public void calsal() {