1. Package access permissions:
2. virtual functions in Java: virtual functions are dynamically bound. in Java, except static methods and final and private
Other methods can be considered as virtual functions, and child classes can override the methods of the parent class,
In C ++, only the virtual method is dynamically bound. During the runtime, determine which function to call,
However, for common functions, it is determined by the compiler, that is, the parent class Pointer Points to the subclass.
Object. For non-virtual functions, the method of calling the parent class is called for virtual functions.
Subclass method. But for Java, as long as it is not a final, static, or private method (belonging to the final method)
All operations are performed according to the virtual function processing method.
3. Final data: public static final string a = "";
Among them, public can be outside the package. Static emphasizes only one copy, and final emphasizes a compiler constant.
The final data of the definition or constructor squadron must be initialized to ensure that values are always assigned during use.
Of
Final method: ensures that the method used in inheritance remains unchanged and will not be overwritten.
Final parameter: The referenced object of the parameter cannot be changed.
Final class: do not want it to have a subclass
4. Private method: the method with the same name in the subclass will not be overwritten, because the private method is not part of the interface, so when we convert the method to the upstream type
The private method of the parent class cannot be called.
5. Java is platform-independent, and the sizes of all types are the same on the platform.
6. Concurrency: If you want to return values from the thread, it is best to implement the callable method, callable <string> Public String call (){}
Call setdaemon before the thread starts, and set it to the background thread.
There are two chapters: