Three years of Java experience, interview preparation (1), java experience

Source: Internet
Author: User
Tags java keywords

Three years of Java experience, interview preparation (1), java experience

Preface

Many things are actually from Baidu on the Internet. The following link is your reference article. Thank you for the link author.

Java keywords

The Java keyword does not count as much as I personally think. Here we select a few uncommon keywords.

1. transient
If a class must implement the Serilizable interface for serialization, but some fields are sensitive (bank accounts and passwords) and cannot be serialized, you can use transient to modify this field.
Online case: http://blog.csdn.net/lfsf802/article/details/43239663

2. volatile
We need to know that every thread maintains its own memory copy for efficiency in multithreading.
When a variable is defined as volatile, it can ensure its visibility into all threads,
That is, when a thread modifies the value of this variable, the new value of the variable can be immediately known to other threads.
It can be understood that all write operations on the volatile variable can be immediately known by other threads.
Online case: http://blog.csdn.net/x_ I _y_u_e/article/details/50728602

Java Collection framework

When talking about the Java Collection framework, you will think of Collectoin, and you will answer the ArrayList \ HashMap \ HashSet, And you will talk about their differences. For more details, we will talk about the HashMap principle, for-each principle, CopyOnWriteArrayList, and ArrayBlockingQueue. Then we will talk about the problems in the java. util. concurrent package.

1. Collectoin Collection framework

2. Differences between ArrayList \ HashMap \ HashSet

3. HashMap Principle

Refer to the following two links. It should be okay if you understand them. Let's briefly explain your understanding after reading them. Before 1.7, HashMap is the list + linked list. After 1.8, it is changed to the list + red/black tree [comparison of the linked list with O (n) and O (logn) with higher efficiency]. Each get/put operation converts the key to a subscript and directly hits data O (1)

Reference: https://www.cnblogs.com/chengxiao/p/6059914.html

Reference: http://www.importnew.com/18633.html

4. for-each principle

 

5. CopyOnWriteArrayList application scenarios

6. Use and principles of ArrayBlockingQueue

 


Related Article

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.