Hari priya wrote:what is the advantage of using this kind of nested interface? Will C have the properties of A and B?
If interface B is only used in combination with interface A you could use a nested interface. This is an indication that interface B belongs somehow to interface A. Map.Entry is one such example.
C will have no combination with A anymore; interface B is implicitly static, and therefore the only real link between A and B is the namespace. A Map.Entry implementation does not need to know anything about the Map interface. For instance,
java.util.AbstractMap.SimpleEntry is a static nested class has just one link to AbstractMap - and that's a static utility method that could just as well been omitted: