Please explain Interface<Interface> of Java generics

Viewed 54

As far as I know <> is used for strict type-checking.

In ArrayList<MyClass> myArrayList; for example, myArrayListwill only accept objects of MyClass as elements and will also return the same. But I don't understand regarding MyInterface<AnotherInterface> MyInterfaceobject;. Here is a little code snippet

public class SplashActivity extends BaseActivity implements SplashMvpView {
@Inject
SplashMvpPresenter<SplashMvpView> mPresenter;

SplashMvpPresenter and SplashMvpView both are interfaces btw.

Link to the actual code: https://github.com/MindorksOpenSource/android-mvp-architecture/tree/master/app/src/main/java/com/mindorks/framework/mvp/ui/splash

Please somebody explain in layman's term the whole OneInterface<AnotherInterface> oneInterfaceObj; thing properly. I'm a beginner.

0 Answers
Related