Java review process

Source: Internet
Author: User
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.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.