Skip to content

Instantly share code, notes, and snippets.

@rynr
Last active November 25, 2019 09:13
Show Gist options
  • Save rynr/e2fccc53f95387e545604d5aabce7d9c to your computer and use it in GitHub Desktop.
Save rynr/e2fccc53f95387e545604d5aabce7d9c to your computer and use it in GitHub Desktop.
class-parameter-of-generic-type
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) {
}
}
public interface SomeInterface<T> {
}
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