15 lines
380 B
Java
15 lines
380 B
Java
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");
|
|
}
|
|
} |