Last active
November 25, 2019 09:13
-
-
Save rynr/e2fccc53f95387e545604d5aabce7d9c to your computer and use it in GitHub Desktop.
class-parameter-of-generic-type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SomeApp { | |
public static void main(String[] args) { | |
SomeApp someApp = new SomeApp(); | |
// this line cannot be compiled: | |
someApp.someMethod(SomeInterfaceImpl.class); | |
} | |
public void someMethod(Class<? extends SomeInterface<?>> param) { | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface SomeInterface<T> { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.flixbus.finance.settlr.generics; | |
public class SomeInterfaceImpl<T> implements SomeInterface<T> { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment