private - Java method access -
i have question public , private classes in java. example, if have public method inside of private class, can public method accessed other public/private classes? in advance.
in order able invoke method inside class, method invocation must have access class itself. therefore, methods of class inside of private class defined have access public method, , methods of other classes not have access.
of course if private class inherits public class or implements public interface, methods of base class or interface visible everyone.
Comments
Post a Comment