Assuming that the following classes are in the same package, which statements are true?
class Main {/* www.j a v a 2s .c om*/ void method1() { } public void method2( { } private void method3( { } protected void method4() { } } class demo [ public void someMethod(String[] parameters) { Main sc = new Main(); sc.method1(); sc.method2(); sc.method3(); sc.method41(); } }
c
As the classes are on the same package and all of the methods are visible except for the private method.