TP-metaprogrammation-test/ExempleDeprecated.java

32 lines
414 B
Java
Raw Normal View History

2021-12-03 14:57:00 +00:00
@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();
}
}