Created
November 11, 2014 10:20
-
-
Save anonymous/66599b123cf8fbe8f131 to your computer and use it in GitHub Desktop.
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 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