-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.java
36 lines (24 loc) · 818 Bytes
/
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package Inheritance;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class Main {
public static void main(String[] args) {
Animal cat = new Animal();
cat.makeSound();
Vehicle car = new Car();
car.drive();
Shape rectangle = new Rectangle(4, 3);
System.out.println(rectangle.getArea());
Employee employee = new HRManager(1, "Alamin", 10000, 8);
System.out.println(employee.getSalary());
employee.work();
HRManager hr = new HRManager(2, "Alamin", 10000, 9);
System.out.println(hr.getSalary());
System.out.println(hr.getWorkHours());
AnimalInterface lion = new Lion();
lion.sound();
AnimalInterface tiger = new Tiger();
tiger.sound();
}
}