JacketPL / KFC

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

KFC

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();
}
/*策略模式*/

图片

img

img1

img2

img3

img4

About


Languages

Language:Java 100.0%