摘要: final 1. 被fina修饰的类,不能被继承; 2. 被final修饰的方法,不能被重写; 3. 被final修饰的变量,不能被再次赋值,意思是被final修饰的是常量。 常量: 字面值常量: 整型常量:10, 小数常量:10.1 字符(串)常量:“abdc” 布尔常量:true 空常量:nul 阅读全文
posted @ 2020-07-23 14:00 游泳的花生人-ATC 阅读(223) 评论(0) 推荐(0)
摘要: class Person { public Person() { } int age; public void setAge(int age) throws AgeOutOfBoundException { //正常code if (age>=0) { this.age = age; } else 阅读全文
posted @ 2020-07-22 15:34 游泳的花生人-ATC 阅读(1409) 评论(0) 推荐(0)
摘要: Throwable类 Error类 两种常见的致命错误 import java.util.ArrayList; public class Demo1 { public static void main(String[] args) { ArrayList<String> A1 = new Array 阅读全文
posted @ 2020-07-20 22:17 游泳的花生人-ATC 阅读(128) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2020-07-17 13:52 游泳的花生人-ATC 阅读(293) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2020-07-16 17:22 游泳的花生人-ATC 阅读(147) 评论(1) 推荐(0)
摘要: 总结: 假如线程调用的是Start方法,那么开启的就是java的多线程功能; 假如调用的是run()方法,那么相当于没有开启新线程,还是直接运行的run方法内部的code。 阅读全文
posted @ 2020-07-16 16:57 游泳的花生人-ATC 阅读(207) 评论(0) 推荐(0)