As the interfaces in Java have methods and constants which are by default public, hence for me interface with default(or no) access specifier is somewhat contradictory as seen in the case below, though the methods in the interface are supposed to be public by default but the interface isn't even visible in packages outside the package it's defined.
package com.anirudh.package1;
interface IAccessSpecifierInterfaceTest {
/**
*
* @param input
*/
void implementMe(String input);
}
package com.anirudh.package2;
public class TryingToImplementDefaultInterfaceFromOtherPackage implements IAccessSpecifierInterfaceTest {
}
TryingToImplementDefaultInterfaceFromOtherPackage gives an error(can't resolve IAccessSpecifierTest
Does anyone know any practical scenario which warrant an interface with default access? and Why?