The assignment will contain 4 departments as four different object classes
i) Super Department
ii) Admin Department
iii) Hr Department
iv) Tech Department
You can declare classes using the keyword 'class' and classes can contain methods and fields and so on :
abstract class Department {
private String name;
private int floors;
abstract void someMethod();
}
class SuperDepartment extends Department {
@Overload
void someMethod() {
// impl logic
}
}
class AdminDepartment extends Department {
@Overload
void someMethod() {
// impl logic
}
}
class HrDepartment extends Department {
@Overload
void someMethod() {
// impl logic
}
}
class TechDepartment extends Department {
@Overload
void someMethod() {
// impl logic
}
}
Comments
Leave a comment