I have a question about public and private classes in Java. For example, if you have a public method inside of a private class, can the public method by accessed by other public/private classes? Thanks in advance.
In order to be able to invoke a method inside a class, the method that does the invocation must have access to the class itself. Therefore, methods of the class inside of which a private class is defined will have access to the public method, and methods of other classes would not have the access.
Of course if a private class inherits a public class or implements a public interface, the methods of the base class or the interface will be visible to everyone.