随笔分类 - Java / 继承
摘要:package com.Demo1; public class Test { public static void main(String[] args) { //掌握在类的构造器中,通过this(...)调用兄弟构造器的作用 Student s1=new Student("李四",26,"家里蹲大
阅读全文
摘要:package com.Demo1; public class Test { public static void main(String[] args) { //搞清楚子类构造器为什么要调用父类构造器,有啥应用场景 Teacher t=new Teacher("李四",36,"Java"); Sy
阅读全文
摘要:package com.extendsDemo; public class Test { public static void main(String[] args) { B b=new B(); System.out.println(b.i); // System.out.println(b.j)
阅读全文