摘要:
异常处理机制 异常处理五个关键字 try、catch、finally、throw、throws 异常抛出、获取 public class Test { public static void main(String[] args) { int a=1; int b=0; try {//抛出异常程序会继 阅读全文
摘要:
封装 public class Pet { private String name; private int age; //无参构造 public void shout(){ System.out.println("叫了一声"); } public String getName() { return 阅读全文