摘要:
public class demo0629 { public static void main(String[] args){ Persons p = new Student();//向上转型 p.eat(); Student s = (Student) p;//向下转型 s.eat(); s.pl 阅读全文
摘要:
class day6_26_1{ public static void mian(String[] args){ Fu2 fu2 = new Zi2();//父类引用子类对象 fu2.print();//fu } } class Fu2{ public void print(){ System.ou 阅读全文
摘要:
public class day_6_25 { public static void main(String[] args){ Zi zi = new Zi(); zi.getName(); }; } /* 在子父类继承 */ class Fu{ String name = "张三"; public 阅读全文
摘要:
//this在private关键字后标准代码该怎么写? /*this代表对象得引用,那个对象调用this所在得方法,this就代表那个对象 this作用:this可以掘金局部变量隐藏成员变量得问题*/ class phone { String name; int age; public void s 阅读全文