tags:

views:

71

answers:

2

I am trying to define HashMap< ? , String> where ? is a class object from some implementation of a given interface, P.

For example, for interface ISearchEngine, i want ? to possibly be Google.class, Yahoo.class, Bing.class, etc.

+6  A: 

How about

HashMap<Class<? extends ISearchEngine>, String>
newacct
A: 

I think you want

HashMap<? extends ISearchEngine, String>
matt b