-
Notifications
You must be signed in to change notification settings - Fork 0
/
Example.java
53 lines (39 loc) · 2.14 KB
/
Example.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package com.trl.theoreticalKnowledge._enum.inheritance.a.a1;
public class Example {
public static void main(String[] args) {
}
}
enum Color {
WHITE, BLACK, YELLOW, RED
}
//enum Color_2 extends Color{} // Compilation ERROR !!!
//enum Color_3 implements Color{} // Compilation ERROR !!!
class SomeClass {
public void someMethod() {
}
}
//enum Color_4 extends SomeClass {} // Compilation ERROR !!!
//enum Color_5 Implements SomeClass {} // Compilation ERROR !!!
//class SomeClass_2 extends Color {} // Compilation ERROR !!!
//class SomeClass_3 implements Color {} // Compilation ERROR !!!
abstract class SomeAbstractClass {
public abstract void someAbstractMethod();
public void someNotAbstractMethod() {
}
}
//enum Color_6 extends SomeAbstractClass {} // Compilation ERROR !!!
//enum Color_7 implements SomeClass {} // Compilation ERROR !!!
//abstract class SomeAbstractClass_2 extends Color {} // Compilation ERROR !!!
//abstract class SomeAbstractClass_3 implements Color {} // Compilation ERROR !!!
interface SomeInterface {
void someMethod();
}
//enum Color_8 extends SomeInterface {} // Compilation ERROR !!!
enum Color_9 implements SomeInterface { // Not Compilation ERROR !!!
;
@Override
public void someMethod() {
}
}
//interface SomeInterface_2 extends Color {} // Compilation ERROR !!!
//interface SomeInterface_3 implements Color {} // Compilation ERROR !!!