class Channel {
@Deprecated // 老系统继续用,新系统不要用了---编译会有提示,但执行成功;
public void connect(){
System.out.println("***** Channel ******");
}
public String connection(){
return "获取了xxx通道信息.";
}
}
public class HelloWorld {
@SuppressWarnings(value = {"deprecation"})// 压制警告
public static void main(String args[]){
new Channel().connect();// 会有提示,但编译成功
}
}
标签:String,void,connect,SuppressWarning,8.12,public,Channel,压制
From: https://www.cnblogs.com/pansidong/p/17464824.html