Page 1 of 1

About Question enthuware.ocajp.i.v7.2.1275 :

Posted: Wed Nov 19, 2014 10:14 pm
by mnellutla
How can you declare 'i' so that it is not visible outside the package test.

package test;
public class Test{
XXX int i;
/* irrelevant code */
}

1)private
2)public
3)protected
4)No access modifier
5) friend

why is 4 not a valid answer? No access modifier is = default = protected right?

private and public i can understand? Please clarify.

Re: About Question enthuware.ocajp.i.v7.2.1275 :

Posted: Wed Nov 19, 2014 10:17 pm
by mnellutla
Sorry miss read the answer... i am good. Late night reading.....