标签:小米 his 对象 static arc div system new strong
package com.bdqn.cn.dao;
class Car{
private String carName;
public Car(String carName)
{
this.carName=carName;
};
public void show()
{
System.out.println("我是"+carName+"具有本功能");
};
}
class RadarCar{
public Car myCar;
public RadarCar(Car myCar)
{
super();
this.myCar=myCar;
};
public void show()
{
myCar.show();
System.out.println("具有打电话功能");
};
}
public class zhuangshizhe {
public static void main(String[] args)
{
Car car=new Car("小米");
car.show();
System.out.println("============");
RadarCar myCar=new RadarCar(car);
myCar.show();
};
}
标签:小米 his 对象 static arc div system new strong
原文地址:https://www.cnblogs.com/yz-bky/p/12887780.html