TP-metaprogrammation-test/TP3/ExempleDeprecated.java
2023-04-22 17:31:03 +02: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();
}
}