Start:
Javac *. Java Compilation
Java * (not file extension)
Super. parent class method and member variable
The constructor number super () of the parent class must be placed in the first statement of the subclass constructor.
Reference package files
Import package name
Create package
Backage package name
When declaring a member variable, the system will assign an initial value, but if it is in the method, it must be declared and initialized at the same time.
Access Modifier
The default access modifier (friendly) can only be used in the same package, and the outgoing package cannot be used even in the subclass .'
Scope: The current class, the same package, different packages, child classes, different packages, and non-Child classes
Public √
Protected √ ×
Friendly √ ××
Private √ ×××
The default value is friendly when no data is written.
Java does not have a GOTO statement, but can have labels. Labels can only be exceeded loop statements and cannot be separated from loop statements.
You can use continue and breake to access tags. You can re-enter the loop after continue to the tag, but cannot re-enter the loop after breake.
Labels are used to exit multi-layer loops.
Label1:
For (;;)
{
Continue label1;
Breake label1;
}
If no new class is used, a null pointer exception occurs.
Abstract class:
A class with an abstract method is an abstract class, which is modified using abstract.
The abstract method does not have a method body. The default value is the public modifier.
You cannot perform the new operation on the abstract class. It is meaningful to have a subclass abstract class.
Abstract and final cannot modify the same class. Final class represents the final class and cannot have subclass.
Start (); // used to call the run () method
Sleep (long T); // t indicates the number of milliseconds of sleep.
Multithreading
Java. Lang. thread package
Extension (extends) Thread class in the class. When the program needs to inherit the Thread class and another class, it can implements the runnable interface and implement the run () method.
All threads in the process share the same memory space.
A process with only one thread is called a single thread.
A process with more than one thread is called multithreading.