Created
March 17, 2016 15:06
-
-
Save moralez/b92a9c4511267c1a9da7 to your computer and use it in GitHub Desktop.
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
import android.util.Log; | |
/** | |
* Created by jmoralez on 3/17/16. | |
*/ | |
public class NestedInterfaces { | |
public NestedInterfaces() {} | |
public void test() { | |
One one = new One() { | |
@Override | |
public void hi(Two two) { | |
Log.i("JMO", "hi"); | |
two.hello(new Three() { | |
@Override | |
public void howdy() { | |
Log.i("JMO", "howdy"); | |
} | |
}); | |
} | |
}; | |
one.hi(new Two() { | |
@Override | |
public void hello(Three three) { | |
Log.i("JMO", "hello"); | |
three.howdy(); | |
} | |
}); | |
} | |
public interface One { | |
void hi(Two two); | |
} | |
public interface Two { | |
void hello(Three three); | |
} | |
public interface Three { | |
void howdy(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment