class NoIPException extends Exception{
public NoIPException(String message){
super(message); //调用了父类一个参数的构造函数
}
}
class Demo79
{
public static void main(String[] args)
{
try{
flyQ(null);
}catch(NoIPException e){
e.printStackTrace();
System.out.println("马上就插上网线!!");
}
}
public static void flyQ(String ip) throws NoIPException{
if(ip==null){
throw new NoIPException("没有插网线啊,小白");
}
System.out.println("好友列表是....");
}
}