老师是进行一步步的往上在走 这个听不懂 或者不想听 要么看看以前的基础,要么不要妄想在学JAVA。 JAVA入门一二三都是最基础的东西这都说不行了 还用学吗
2016-06-11
//父类的引用调用本类的方法
Vehicle obj1=new Vehicle();
obj1.transport();
//父类的引用调用子类重写的方法
Vehicle obj2=new Bus();
Vehicle obj3=new Plane();
Vehicle obj4=new Ship();
obj2.transport();
obj3.transport();
obj4.transport();
//父类的引用调用子类继承的方法
Vehicle obj5=new Bicycle();
obj5.transport();
Vehicle obj1=new Vehicle();
obj1.transport();
//父类的引用调用子类重写的方法
Vehicle obj2=new Bus();
Vehicle obj3=new Plane();
Vehicle obj4=new Ship();
obj2.transport();
obj3.transport();
obj4.transport();
//父类的引用调用子类继承的方法
Vehicle obj5=new Bicycle();
obj5.transport();
2016-06-11
写了好久再次奉献上我写的答答打车系统,欢迎交流!!!欢迎指点!!!认为写的好给个赞!
http://www.imooc.com/article/8889
http://www.imooc.com/article/8889
2016-06-08