JAVA面向对象程序设计-FeiGe快递系统-继承
`
public class vehicle {
public int wheel;
public void start(){
System.out.println(“vehicle的start方法启动”);
}
private String enginebrand;
protected void end(){
System.out.println(“熄火”);
}
}
![在这里插入图片描述](https://img-blog.csdnimg.cn/20191010174805588.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0JPR0VXSU5H,size_16,color_FFFFFF,t_70)
public class sedan extends car {
public void manned(){
System.out.println(“可载人”);
}
public static void main(String[] args) {
sedan sedan =new sedan();
sedan.start();
}
}
![在这里插入图片描述](https://img-blog.csdnimg.cn/20191010174926981.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0JPR0VXSU5H,size_16,color_FFFFFF,t_70)
public class car extends vehicle {
public double carheight;
public void run(){
System.out.println(“启动快”);
}
public static void main(String[] args) {
car car =new car();
car.start();
car.end();
car.run();
}
}
![在这里插入图片描述](https://img-blog.csdnimg.cn/20191010175205771.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0JPR0VXSU5H,size_16,color_FFFFFF,t_70)