corejava
文章平均质量分 76
臭臭臭1717
no one
展开
-
[core java]C4 Objects and Classes
final &static关键字private final String name; 当constuctor调用时一定要被初始化public static final double PI = 3.14..... // final type in class field final对象和final引用public class System{public static fi...原创 2018-09-11 15:25:58 · 120 阅读 · 0 评论 -
[core java]C3 Fundamental Programing Structure
c3主要讲了基本类型的使用方法,包括基本类型 String 输入输出 数组目录基本类型:1.基本类型2.基本类型的精度问题Stringstring的immutable特性StringBuffer和StringBuilder ArrayArray的复制二维数组的遍历二维数组的逻辑模型基本类型:1.基本类型java中分为内置类型(包括基本类型)...原创 2018-09-11 15:26:18 · 192 阅读 · 0 评论 -
[Core Java]C5 Inheritance
继承的宗旨(求同存异):When defining a subclass by extending its superclass, you only need to indicatethe differences between the subclass and the superclass. When designing classes,you place the most general...原创 2018-10-05 19:52:53 · 130 阅读 · 0 评论 -
[Core Java]C5 Reflection
反射的作用• Analyze the capabilities of classes at runtime;(在运行时获取类的信息)• Inspect objects at runtime—for example, to write a single toString method that works for allclasses;(通过反射获取field,可以设计所有类通用的toStr...原创 2018-10-05 20:30:45 · 138 阅读 · 0 评论 -
[Core Java]C6 Interface
Interface 特性接口不允许有Instance Field和Static Methods,所有方法自动为public,所有field自动为public static finalInterface引用可以指向实现它的类的对象Comparable x = new Employee();可用Instanceof判断一个对象的所属类是否实现了该接口if(x instanceof ...原创 2018-10-09 17:46:51 · 152 阅读 · 0 评论 -
[Core Java]C6Inner Class
内部类举例内部类TimerPrinter实现Actionlistener接口,内部类的对象做计时器Timer的回调对象public class InnerClassTest{ public static void main(String[] args){ TalkingClock clock = new TalkingClock(1000,true);//创建一个外部类...原创 2018-10-10 11:20:44 · 151 阅读 · 0 评论