33 lines
497 B
Java
33 lines
497 B
Java
import java.lang.Integer;
|
|
|
|
interface A {
|
|
void method1();
|
|
default method2() {
|
|
}
|
|
}
|
|
|
|
interface B {
|
|
void method3();
|
|
}
|
|
|
|
interface C {
|
|
Integer myInt();
|
|
}
|
|
|
|
class ClassX implements A {
|
|
}
|
|
|
|
record ClassY(Integer myInt) implements C {}
|
|
|
|
public class Interfaces implements A, B {
|
|
public void method1() {
|
|
}
|
|
public void method3() {
|
|
var intf = new Interfaces();
|
|
intf = new ClassX();
|
|
intf.method1();
|
|
|
|
C c = new ClassY(10);
|
|
c.myInt();
|
|
}
|
|
} |