标签:return 练习 rac bst car end pac bsp new
package ab2; public abstract class Vehicle { public abstract String nowheel(); }
package ab2; public class Car extends Vehicle{ public String nowheel(){ String l="四个轮子"; return l; } }
package ab2; public class Mo extends Vehicle { public String nowheel(){ String s="两个轮子"; return s; } }
package ab2; public class Test { public static void main(String[] args) { Car c=new Car(); System.out.println(c.nowheel()); Mo m=new Mo(); System.out.println(m.nowheel()); } }
标签:return 练习 rac bst car end pac bsp new
原文地址:http://www.cnblogs.com/zyy1130/p/6710326.html