About Question enthuware.ocajp.i.v7.2.1275 :
Posted: Wed Nov 19, 2014 10:14 pm
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.
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.