wood burning stoves 2.0*
The moose likes Java in General and the fly likes type parameter extends 2 interfaces Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "type parameter extends 2 interfaces" Watch "type parameter extends 2 interfaces" New topic
Author

type parameter extends 2 interfaces

Henrique Ordine
Ranch Hand

Joined: Sep 03, 2004
Posts: 127
I`d like to declare a type param which extends two interfaces. Is that possible?
I tried <T extend IA, IB> but the compiler thinks IB is another type parameter.

Any help will be really appreciated.


J2EE Architect/Developer
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19655
    
  18

Use &:


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Henrique Ordine
Ranch Hand

Joined: Sep 03, 2004
Posts: 127
cool, thanks again rob.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38064
    
  22
Surely it's "extends" not "extend"?
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19655
    
  18

Surely it is. I guess I copied Henrique's typo.
 
jQuery in Action, 2nd edition
 
subject: type parameter extends 2 interfaces
 
Similar Threads
testing domain-model in DDD (subclass vs. interface-impl)
How to create black buttons with white font?
Which implementation is better: Calling methods by several arguments or encapsulating in an object?
Generic programming
Generics - Bounded Parameterized Types