This discussion is archived
4 Replies Latest reply: Jul 2, 2013 12:53 AM by gimbal2 RSS

How to use Enum on Generic Type

Pradeep Newbie
Currently Being Moderated

I am trying to create a class as generic type, that can only carry one of the values from an enum


For. eg :

Class Test<T>





This T should only be either String or Integer


How can I do this ?


Thanks in advance.


  • Correct Answers - 10 points
  • Helpful Answers - 5 points