Java Nested Interface
Java Nested Interface: inner/nested classes live inside another class. Java Nested Interface is useful for helpers tightly coupled to the outer type.
Java Nested Interface — anonymous class = one-off implementation.
Java Nested Interface — static nested class does not need outer instance.
Write one tiny example for Nested Interface. Compile, print one result, and say the output out loud before you type.
Use Nested Interface only when the problem needs it. Don’t force it into every program. Know one beginner trap.
Let's take this on the board with one tiny Main class — no extra files. Java Nested Interface — static nested Pair groups two ints with the outer Main type. Start from main, go line by line, and stop at each print. That output is the proof for Nested Interface.
Give one real use: event listener / Comparator.