摘要: java.lang.Throwable 异常处理机制:抛出异常 捕获异常 异常处理的五个关键词:try catch finally throw throws package com.exception; public class Test { public static void main(Stri 阅读全文
posted @ 2022-07-31 17:43 是貓阿啊 阅读(35) 评论(0) 推荐(0)
摘要: package com.oop; import com.oop.demo10.Outer; public class Application { public static void main(String[] args) { //外部 new Outer outer = new Outer(); 阅读全文
posted @ 2022-07-31 09:37 是貓阿啊 阅读(19) 评论(0) 推荐(0)
摘要: package com.oop.demo08; //abstract 抽象类 类:extends 单继承 但是 接口可以多继承 public abstract class Action { //约束,有人帮我们实现 //abstract 抽象方法 只有方法名字 没有方法实现 public abstr 阅读全文
posted @ 2022-07-31 09:14 是貓阿啊 阅读(38) 评论(0) 推荐(0)
摘要: package com.oop.demo07; //static public class Student { private static int age;//静态变量 private double score;//非静态变量 public void run(){ } public static 阅读全文
posted @ 2022-07-31 08:27 是貓阿啊 阅读(72) 评论(0) 推荐(0)
摘要: 封装: package com.oop; import com.oop.demo03.Pet; import com.oop.demo04.Student; /* 1.提高程序的安全性,保护数据 2.隐藏代码的实现细节 3.统一接口 4.系统的可维护性提高了 */ //一个项目应该只存在一个main 阅读全文
posted @ 2022-07-31 08:17 是貓阿啊 阅读(24) 评论(0) 推荐(0)