Java Generics in combination with interface inheritance?

When leaving out generic parameters, almost all of the generics logic is skipped. Determining the type of T will not be 'smart' and just look at the way T is defined within that class/interface If you want to use the generics logic, you should provide generic parameters instead of leaving them out - they can still be very, well, 'generic': SomeInterface2 si1; si1.get().method().

When leaving out generic parameters, almost all of the generics logic is skipped. Determining the type of T will not be 'smart' and just look at the way T is defined within that class/interface. If you want to use the generics logic, you should provide generic parameters instead of leaving them out - they can still be very, well, 'generic': SomeInterface2 si1; si1.get().method().

Since you're not using a type parameter when declaring the object of type SomeInteface1, the java compiler has no idea what actual class/interface it'll return when you invoke get(). The only thing that's certain is that it's an interface that extends Type0 (given the declaration of SomeInterface0). When you call get(), the compiler is checking the signature of the interface where get() is declared, so the only methods it knows can be called (without explicit type parameter being given), are the methods declared in Type0.

Let me know if I was too confusing, I'll try to clear up the answer! :P.

Thanks, I've got the idea! )) – dbolotin Oct 2 at 16:01.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions