خرید بک لینک

Vote count: 0

In Java, co-variance for a generic can be defined as <? extends Clazz> and contra-variance can be defined as <? super Clazz>, but is it possible to define both of these traits at once? Take this case for example:

interface Foo{}
interface Fizz extends Foo{}
interface Buzz extends Foo{}
class Bar implements Fizz, Buzz{}

Is it possible to restrict the type to only Fizz and Buzz?

Something like <? extends Foo super Bar>


Disclaimer: I am not actually writing code like this

asked 8 mins ago

برچسب: نویسنده: استخدام کار تاريخ: چهارشنبه 1 ارديبهشت 1395 ساعت: 23:08

صفحه بندی