- 博客(5)
- 收藏
- 关注
原创 设计原则-里氏替换原则
If for each object o1 of type S there is an object o2 of type T such that for all programs P defined in terms of T,the behavior of P is unchanged when o1 is substituted for o2 then S is a subtype of
2017-09-21 14:57:51 171
原创 6大设计原则-单一职责原则
There should never be more than one reason for a class to change.But this is sometime hard to see.难点:划分职责优点:1.类的复杂性降低,实现什么职责都有清晰明确的定义; 2.可读性提高,复杂性降低; 3.可维护性提高,可读性
2017-09-20 09:40:35 188
原创 Java-类
类包含两种信息:属性和行为(方法)属性: [变量修饰符]; 变量修饰符:public、protected、private、默认(frieddly)行为: [方法修饰符]([]); 方法修饰符:public、private、protected、final、static、abstract、synchronized。Class Vo
2017-09-16 21:06:54 118
原创 Java-类的调用
类的调用: 1、变量名.方法 前提:实例 2、类名.方法 前提:static//变量名.实例public class P { public double getP() { return 0; }}P P1=new P;System.out.println(P1.getP());//类名.方法 staticpublic
2017-09-16 17:27:29 152
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人