Java Learning notes Record

Source: Internet
Author: User

1, ordinary class methods can be the same name as the class names, and the construction method is the only distinction is that the construction method does not return a value

2, string[] ss = new STRING[10]; Ss.length = 10; A[0]~A[9] = null

int[] ss = new INT[10];  Ss.length = 10; A[0]~A[9] = 0

3. thread is divided into daemon thread and non-daemon thread (i.e. user thread)

The daemon thread works as long as any non-daemon threads in the current JVM instance do not end;The daemon thread ends up working with the JVM only when the last non-daemon thread ends. the most typical application for daemon threads is the GC (garbage collector) 4, volatile keyword used in multi-threaded synchronization, can guarantee the visibility of the read, can not guarantee thread safety 5, there is the number of I + 1 < I, that is, when I is an int type and I is the maximum value, 2^32-1, i+1 will overflow into negative 6, the inputstream (input)/outputstream (output) is the suffix of the byte stream; The word stream is suffixed with reader (input)/writer (output) 7, about the bit operation in Java, the right shift 1 is equivalent to 2, the left Shift 1 is equivalent to multiply 2
int i = ten;    //2 binary: 1010        System.out.println (i << 1);    // output 20, left 1 digits after: 10100=20        System.out.println (i << 2);    // output 40, left 2 bit after: 101000=40//// Output 2, right to move 1 bit after: 0010=2        

20160215

1. The order in which the static variables of a class is assigned is executed in the order in which the code is written.

2, the Java reflection mechanism is in the running state, for any class, can know all the properties and methods of this class, for any one object, can call any of its methods and properties; This dynamically acquired information and the ability to dynamically invoke the object's methods are called the reflection mechanisms of the Java language.

JDK Source view

Spring Source, etc.

Java Learning notes Record

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.