Java Basic Three

Source: Internet
Author: User

1, multithreaded Programming:

The difference between a thread and a process: the process requires a separate memory space, the process shuts down so the thread shuts down, and the thread can share memory and resources, and the thread shutdown process does not shut down.

The thread class and the Runnable class, the creation of threads: 1, inherits the thread class instantiation of a thread, then overrides the thread's Run method, then calls the Start method to start the thread; 2, implements a runnable interface, Create a runnable class and instantiate and pass the instance into the constructor of the thread class, and then call the Start method of the thread class instance;

Thread Priority (SetPriority): The higher the number, the higher the power, the default number is 5;

The difference between setsleep () and Tostop () is that the former is suspended and the latter is directly stopped;

Thread synchronization: synchronization block, keyword synchronized (lock object), sometimes deadlock;

2,java Collection Framework:

The collection framework is divided into collection interfaces and iterator interfaces (ergodic): The 1,collection interface is divided into set sets (objects are not sequential and cannot be duplicated) and list sets (objects are ordered and can be duplicated);

Map interface consists of key-value pairs, key objects are not repeatable, key values can be repeated;

The iterator () method of the iterator walker accesses either an element or a foreach method;

ArrayList: Generic: Canonical data type to avoid type conversion errors;

ArrayList and LinkedList: The former is of high efficiency, the latter is efficient in inserting and deleting;

3, Reflection:

Class loading mechanism: Load, link, initialize;

Use reflection to view class information: Common Method Class.forName ("Fully qualified class name");

Garbage collection mechanism, Finalize () method;

4,java Graphical Interface Programming:

The graphical interface includes AWT (heavyweight components) and swing (lightweight components), containers and components, and containers as well as components;

Heavyweight containers in swing include forms, dialog boxes, windows, and small programs.

The layout of the container, common flow layout, border layout, grid layout and box layout;

Java Basic Three

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.