Skip to content

Commit 9d7e6a5

Browse files
committed
Fifth Recorded Day
1 parent 56368ba commit 9d7e6a5

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

Polymorphism/Main.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
public class Main {
2+
public static void main(String[] args) {
3+
4+
Car car = new Car();
5+
Bike bike = new Bike();
6+
Boat boat = new Boat();
7+
8+
VehicleInterface[] vehicles = {car, bike, boat};
9+
10+
for(VehicleInterface vehicle : vehicles) {
11+
vehicle.go();
12+
}
13+
}
14+
}

0 commit comments

Comments
 (0)