Skip to content

Instantly share code, notes, and snippets.

Created November 11, 2014 10:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/66599b123cf8fbe8f131 to your computer and use it in GitHub Desktop.
Save anonymous/66599b123cf8fbe8f131 to your computer and use it in GitHub Desktop.
public class Test {
interface Func {
void call();
}
private void common(Func func) {
// Common codes...
func.call();
// Common codes...
}
public void A() {
common(new Func() {
@Override
public void call() {
// A specified codes...
}
});
}
public void B() {
common(new Func() {
@Override
public void call() {
// B specified codes...
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment