Java语言的对象.ppt

Java语言的对象

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * 继承的实现 Class Student extends person { public string specialty; public int class; public void sleep(); public void levelup(); } 继承的另一个例子 public class Che { private int wheel = 4; public int getWheel() { return wheel; } public class Jiaoche extends Che { private String pinpai = 桑塔纳; public String getPinpai() { return pinpai; } } public class Testche { public static void main(String[] args) { Jiaoche car = new Jiaoche(); int wheels = car.getWheel(); //调用基类的方法 String Pinpal = car.getPinpai();//调用本身的方法 S

文档评论(0)

1亿VIP精品文档

相关文档