Skip to content

Instantly share code, notes, and snippets.

@anna-is-cute
Created July 12, 2014 20:43
Show Gist options
  • Save anna-is-cute/bdd57fef083ee9dbe4f7 to your computer and use it in GitHub Desktop.
Save anna-is-cute/bdd57fef083ee9dbe4f7 to your computer and use it in GitHub Desktop.
public class Bicycle {
// code
}
public class CoolBike extends Bicycle {
// code
}
public void doSomething(Class<? extends Bicycle> bikeClass) {
new Runnable() {
public Runnable(CoolBike cb) { // need this to be generic, but it can't just use Bicycle, it needs to specify CoolBike
// stuff
}
public void run() {
// more stuff
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment