interface Int {
public void show();
}
Int t1 = new Int() {
public void show() {
System.out.println("message");
}
to.show();
You're defining an anonymous class that implements the interface Int
, and immediately creating an object of type thatAnonymousClassYouJustMade
.