package com.activity;
public class Zero implements ActivityPrice{
public float buy() {
return 0;
}
}
package com.activity;
public class One implements ActivityPrice {
public float buy( ) {
return 10;
}
}
package com.activity;
public class ConText {
private ActivityPrice act;
public ConText(ActivityPrice one) {
this.act = one;
}
public float call() {
return act.buy();
}
}
package com.activity;
public interface ActivityPrice {
float buy();
}
/*策略模式*/