Well any Java programmer knows that a Java Interface only allows declaration of methods. You cannot define the methods inside interfaces.
Yet if somebody like me wants you to define a method in interface and wants the program gets compiled and runs successfully, what would you do?
Well the answer is Inner Classes in Java. Through Inner classes, you can define a method in interfaces and run your programs.
Here's what you need to do: