请看下面的代码。我看不出哪里出错了。我也很迷茫!非常感谢任何帮助!
package code;
public class Client {
public static void main(String[] args){
proxyPlane plane = new proxyPlane(new Pilot(18));
plane.flyPlane();
plane = new proxyPlane(new Pilot(25));
plane.flyPlane();
DecoratedPilot decPilot = new Pilot(35);
System.out.println("Experienced Pilot of age " + Pilot.Age() + " " + decPilot.getDecotation());
}
}
package code;
public interface DecoratedPilot {
public String getDecotation();
}
package code;
public class Decoration extends PilotDecorator {
public Decoration(Pilot pilot) {
super(pilot);
// TODO Auto-generated constructor stub
}
@Override
public String getDecotation() {
return "Pilot has earned his Commercial Wings";
}
}
package code;
public abstract class PilotDecorator implements DecoratedPilot {
public PilotDecorator(Pilot pilot)
{
apilot = pilot;
}
}
package code;
public class Pilot implements DecoratedPilot {
private static int age;
public static int Age() {
return age;
}
public Pilot(int age){
Pilot.age = age;
}
public String getDecotation() {
// TODO Auto-generated method stub
return null;
}
}