NTU-OOP-Tuts-2024/T5Q2-B-FromSol2/src/Main.java

15 lines
380 B
Java
Raw Normal View History

2024-10-17 11:51:59 +08:00
public class Main {
public static void main(String[] args) {
// I - Works
ClassC c = new ClassD();
c.print("hello", "there");
// II - Does not compile because class C is abstract
// ClassA a = new ClassC();
// a.print(1, "there")
// III - Works
ClassF a = new ClassF();
a.print("hello", "there");
}
}