TP-metaprogrammation-test/ExempleDeprecated.java
2021-12-03 15:57:00 +01:00

32 lines
414 B
Java

@Deprecated
class A { }
class B {
@Deprecated
public void m() {
System.out.println("B.m();");
}
}
public class ExempleDeprecated {
void m1() {
A a = new A();
B b = new B();
b.m();
}
//@SuppressWarnings("deprecation")
void m2() {
A a = new A();
B b = new B();
b.m();
}
public static void main(String[] args) {
ExempleDeprecated ED = new ExempleDeprecated();
ED.m1();
ED.m2();
}
}