Hiding the implementation
This sentence is very good:
In any relationship, it's important to have boundaries that are respected by all parties involved.
Regardless of your relationship, it is important to have a line of mutual respect.
#----
Classpath (in upper case, it is best to add the current directory .):
The Java interpreter looks for the. Class file in the following two places:
1. Standard Directory of JDK
2. Path = use classpath as the root directory + package (for example, net. libk)
#----
Public> protected (allow includes package permission)> package> private
#----
Package net. libk; this indicates that the current class must be under classpath/NET/libk
#----
Singleton pattern: only one instance/Object of the class can be created.
Define constructor as private so that client programmer cannot create an object, and then define a private static member variable pointing to an instance of this class,
Create a public static method and return the Private Static Field.
For example:
Class Singleton {
Private Singleton (){};
Private Static instance = new Singleton ();
Pubic static Singleton access (){
Return instance;
}
}
#----
If the imported class library has a duplicate Name Conflict, use the full name to resolve the conflict.
Java. util. Vector v = new java. util. vector ();
#----
Compiling unit:
A. Java source file. Compiling unit can have all classes, but only one public class is allowed. If there is a public class,
The file name must also be the same as the class name, and other classes will become the auxiliary class of this public class.
#----
Class access specifier only supports public and package. (Except inner class)