Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Test {
- public static void main(String[] args) {
- Buy buy1 = new Buy();
- buy1.buy(5, Thing.A, new Seller());
- }
- }
- class Seller {
- }
- interface Buyer<E extends Enum<E>> {
- void buy(int numOfItem, E e, Seller seller);
- }
- enum Thing {
- A, B, C;
- }
- class Buy implements Buyer<Thing> {
- public void buy(int numOfItem, Thing e, Seller seller) {
- System.out.println("Buying "+numOfItem+ " " + e);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment