Created
January 22, 2015 14:17
-
-
Save ishankhare07/dca2b785f48556c006d3 to your computer and use it in GitHub Desktop.
java interface implementation via object creation
This file contains hidden or 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
interface onClickListener { | |
public void onClick(); | |
} | |
public class Practice { | |
public static void main(String[] args) { | |
onClickListener my_listener = new onClickListener() { | |
@Override | |
public void onClick() { | |
System.out.println("this is a demo"); | |
} | |
}; | |
my_listener.onClick(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment