Java knowledge Point: Read thousands of books, walk the road (ii)

Source: Internet
Author: User
Tags volatile

    • Local variable: Variables declared in the method body
    • Environment variables can be specified when compiling source code
    • identifier = variable Name
    • Array is not a native class
    • Only abstract and public can modify interface
    • Extensions: Abstract and final conflicts, cannot decorate a class
    • Instance method: A method that can be accessed through an instance of a class
    • class method = static method = Statics

    • Propagation: Transaction propagation behavior

Propagation_REQUIRED

If there is no current transaction, create a new transaction, if one is already present, join the transaction. This is the most common choice.

Propagation_SUPPORTS

Supports the current transaction and is executed in a non-transactional manner if no transaction is currently in use.

Propagation_MANDATORY

Throws an exception if no transaction is currently in use for the current transaction.

Propagation_requires_new

Creates a new transaction, suspending the current transaction if the transaction currently exists.

Propagation_not_supported

Executes the operation in a non-transactional manner, suspending the current transaction if a transaction is currently present.

Propagation_never

Executes in a non-transactional manner, throwing an exception if a transaction is currently present.

Propagation_NESTED

Executes within a nested transaction if the transaction is currently present. If there is currently no transaction, perform a similar operation as propagation_required.


    • Static include VS dynamic include
Static include: include, post-compile, consider the included file as a whole dynamic include: Compile first, then include


    • Volatile
When reading a variable, in order to improve access speed, the compiler will sometimes read the variable into a register, and then take the value of the variable, directly from the register to the value optimizer when using the volatile variable must be carefully read the value of the variable every time, instead of using the backup stored in the Register Volatile for variables shared by several tasks in multi-threaded applications
    • Loader:
Boot class loader (bootstrap class loader): It is used to load Java's core library, which is implemented with native code. Extend my loader (Extensions class loader): It is used to load the Java extension Library system ClassLoader Class loader): It loads Java classes according to the Classpath (class path) of Java applications, and Tomcat creates a loader for each app that holds the classloader of this webapp. When you need to load a class under WebApp, Just take out the classloader and use it.


Java knowledge Point: Read thousands of books, walk the road (ii)

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.