Skip to content

Instantly share code, notes, and snippets.

@kasramp
Created August 3, 2020 20:35
Show Gist options
  • Save kasramp/60397d7726d951c8792a5599e8ff3d21 to your computer and use it in GitHub Desktop.
Save kasramp/60397d7726d951c8792a5599e8ff3d21 to your computer and use it in GitHub Desktop.
MyClass mc = new MyClass();
MethodNeedsObject(mc);
// We can change the above example to below,
MethodNeedsObject(new MyClass());
// For defining anonymous class see the follow example,
MethodNeedsObject( new MyClass() {
public void MyMethod(int x, int y) {
//Do some operations;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment