Click here to watch in Youtube :
https://www.youtube.com/watch?v=rj4ASD_LMRU&list=UUhwKlOVR041tngjerWxVccw
Click the below Image to Enlarge
Java Tutorial : Java Anonymous inner class(Using Interface) |
Java Tutorial : Java Anonymous inner class(Using Interface) |
Java Tutorial : Java Anonymous inner class(Using Interface) |
interface Person { public abstract void walk(); }
public class Student { public static void main(String args[]) { Person personRef = new Person() { public void walk() { System.out.println("Walking fast"); } }; personRef.walk(); } }
Walking fast
https://sites.google.com/site/javaee4321/java/NestedClassDemo-Anonymous%20inner%20class-interface-App.zip?attredirects=0&d=1
Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava/NestedClassDemo-Anonymous%20inner%20class-interface-App
Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/b2f5bc83a6afc94a18aa8491d69c8866cf710cff/BasicJava/NestedClassDemo-Anonymous%20inner%20class-interface-App/?at=master
See also:
No comments:
Post a Comment