Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.36 KB | None | 0 0
  1. import java.util.*;
  2.  
  3. public enum CollectionType
  4. {
  5.     TreeSet(TreeSet.class),
  6.     ArrayList(ArrayList.class),
  7.     LinkedList(LinkedList.class);
  8.    
  9.     private final Class<?> collectionClass;
  10.    
  11.     private CollectionType(Class<?> collectionClass) {
  12.         this.collectionClass  = collectionClass;
  13.     }
  14.  
  15.     public Class<?> getCollectionClass()
  16.     {
  17.         return collectionClass;
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement