I have a doubt regarding to java. Can we declare a class inside an interface? Ans :yes But what will be the situation?
I am not getting why it is required...........
Can u plz share ur answer
I translate this question as follows: "Can anyone think of a reason why it would be useful to declare an inner class inside an interface?"
If my translation is correct, my answer to it is: No, I can't think of a single reason or application requirement where it would be useful. In fact it surprises me that it is possible, I never even considered to go find out.
I've done it many times. For example, a Factory class. There is also a use case in RMI that's in my book: an abstract base class that implemented the remote interface, in case you had multiple implementations.