- In Java, arrays are passed in the form of references.
- If the ToString () method is not defined, the print behavior prints the name of the class and the address of the object . such as: [email protected]
- there can be only one public class within each compilation unit. Although not commonly used, it is possible to have no public classes in the compilation unit at all. In this case, you can name the file arbitrarily.
- In Java, if you use the package statement, it must be the first sentence other than the comment.
- If you do not provide any access, it means that it is "package access rights." The default access permission does not have any keywords, but it usually refers to "package access rights" (which is sometimes represented as friendly);
- A class cannot be private (this makes it inaccessible to any class other than the Class), nor can it be a protected. So access to a class has only two choices: package access orpublic. (PS: An inner class can be private or protected, but that is a special case.) )
[Think in Java] knowledge points-access rights control