The following code does not compile. The compiler states that you can not reduce the visibility of the inherited method. This is fair enough! However, if you look at the method doSomething in the interface it has the default package level. If you also look at the method doSomething in the class it has the package level there as well. How am I reducing it?
nterface myInterface {
void doSomething(); }
public class myClass implements myInterface {
void doSomething() { // If this method is public then it compiles. How am i reducing it? System.out.println("I am doing something"); } }