Issue
interface Int {
public void show();
}
Int t1 = new Int() {
public void show() {
System.out.println("message");
}
to.show();
Solution
You're defining an anonymous class that implements the interface Int
, and immediately creating an object of type thatAnonymousClassYouJustMade
.
Answered By - Pops
Answer Checked By - Clifford M. (JavaFixing Volunteer)