摘要: package com.Demo2;//自定义异常类public class MyException extends Exception { //传递数字>10 private int detail; public MyException(int a) { this.detail = a; } // 阅读全文
posted @ 2022-02-21 15:01 程序猿009 阅读(40) 评论(0) 推荐(0)
摘要: 异常处理五个关键字:try 、catch 、 finally 、 throws public class Test { public static void main(String[] args) { int a = 1; int b = 0; try {//try监控区域 System.out.p 阅读全文
posted @ 2022-02-21 12:38 程序猿009 阅读(55) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2022-02-21 12:01 程序猿009 阅读(23) 评论(0) 推荐(0)
摘要: package com.oop.Demo9;public class Outer { private /*static*/ int id=10; public void out(){ System.out.println("这是外部类的方法"); } public class Inner{ publ 阅读全文
posted @ 2022-02-21 11:25 程序猿009 阅读(44) 评论(0) 推荐(0)