Java – UML Class Diagram and Generics

javauml

How do you indicate a generic class or interface in a Class Diagram?

I'm looking for two things really:

  1. One is how do I model generic java classes if i were doing it with pen and paper.
  2. Secondly, what uml tools out there support generic classes/interfaces.

Thanks!

Best Answer

Usually generics are represented as classifier's template parameter. Here is the example how it looks like in the NetBeans UML Plugin:

enter image description here