上一页 1 ··· 6 7 8 9 10 11 12 13 下一页
摘要: this 可以在构造方法之间进行调用 *this在构造方法之间调用 this() 阅读全文
posted @ 2019-03-17 20:08 芯-觞 阅读(170) 评论(0) 推荐(0) 编辑
摘要: package lijun.cn.demo4; public class Person { int num =777; public Person(){ System.out.println("父类的构造方法"); num=666; } } package lijun.cn.demo4; // 子类 super() ... 阅读全文
posted @ 2019-03-16 16:40 芯-觞 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 多态调用的三种格式 * A:多态的定义格式: * 就是父类的引用变量指向子类对象 父类类型 变量名 = new 子类类型(); 变量名.方法名(); * B: 普通类多态定义的格式 父类 变量名 = new 子类(); * C: 抽象类多态定义格式 抽象类 变量名 = new 抽象类子类();... 阅读全文
posted @ 2019-03-15 16:16 芯-觞 阅读(510) 评论(0) 推荐(0) 编辑
摘要: * B : 定义格式 ***** public interface 接口名 { 抽象方法1; 抽象方法2; 抽象方法3; } * C: 定义步骤 使用interface代替了原来的class,其他步骤与定义类相同: 接口中的方法均为公共访问的抽象方法 ... 阅读全文
posted @ 2019-03-15 16:11 芯-觞 阅读(109) 评论(0) 推荐(0) 编辑
摘要: package cn.chouxiang.demo3; public abstract class Develop { public abstract void work(); public void wo(){ System.out.println("普通方法"); } } package cn. 阅读全文
posted @ 2019-03-15 16:07 芯-觞 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 继承后 子类,父类成员方法的特性 》子类重写父类方法 ***** a:子类的对象调用方法的时候,子类自己有,使用子类,子类自己没有调用的父类 b:子类中出现与父类一模一样的方法时,会出现覆盖操作,也称为override重写、复写或者覆盖 } c:为什么重写父类的方法 父类的方法 最先存在的 那么如果 阅读全文
posted @ 2019-03-15 16:03 芯-觞 阅读(693) 评论(0) 推荐(0) 编辑
摘要: package cn.lijun.demo6; public class Text4 { public static void main(String[] args) { int[] arr={12,34,45,33,66,88,99}; reverse(arr); printArray(arr); } privat... 阅读全文
posted @ 2019-03-13 19:25 芯-觞 阅读(110) 评论(0) 推荐(0) 编辑
摘要: package cn.lijun.demo6; public class Test3 { public static void main(String[] args) { for(int j=1;j<10;j++){ for(int i=1;i<=j;i++){ System.out.print(j+"*"+i+... 阅读全文
posted @ 2019-03-13 19:24 芯-觞 阅读(263) 评论(0) 推荐(0) 编辑
摘要: package cn.lijun.demo6; public class Test2 { public static void main(String[] args) { for(int i=100;i<1000;i++){ int bai=i/100%10; int shi=i/10%10; in... 阅读全文
posted @ 2019-03-13 19:14 芯-觞 阅读(539) 评论(0) 推荐(0) 编辑
摘要: package cn.lijun.demo6; public class Text { public static void main(String[] args) { int[] arr={12,69,852,25,89,588}; selectS(arr); //比较 printS(arr); //遍历 ... 阅读全文
posted @ 2019-03-13 18:50 芯-觞 阅读(124) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 下一页