Java three years work experience interview preparation (i)

Source: Internet
Author: User
Tags volatile java keywords

Objective

Many things are actually their own online Baidu, the following link is their own reference to the article, thanks to the link author

Java keywords

Java keyword personal feeling accounted for not many, here selected a few less commonly used keywords

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

2.volatile
Before you know it, for the sake of efficiency, each thread will maintain a copy of its own memory.
When a variable is defined as volatile, this variable is guaranteed to be visible to all threads,
That is, when a thread modifies the value of this variable, the new value of the variable is immediately known to other threads.
It can be understood that all write operations on volatile variables are immediately known to other threads.
Online Case: http://blog.csdn.net/x_i_y_u_e/article/details/50728602

Java Collection Framework

When it comes to the Java Collection framework, you'll think of Collectoin, and you'll answer arraylist\hashmap\hashset, and you'll talk about their differences. If more in-depth, hashmap principle, For-each principle and copyonwritearraylist, arrayblockingqueue and chat to these two classes, And then we'll talk about the problem under the java.util.concurrent bag.

1.Collectoin Set Frame

2.arraylist\hashmap\hashset differences

3.HashMap principle

Refer to the following two links, as long as you understand should be no problem, simply tell the understanding after you have seen. HashMap before 1.7 is the list + linked lists, 1.8 after changed to the list + red black tree [linked list more efficient O (n) and O (logn) comparison]. The key is converted to subscript every time get\put, the direct hit Data O (1)

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

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

4.for-each principle

5.CopyOnWriteArrayList Application Scenarios

6.ArrayBlockingQueue Usage and principle


Java three years work experience interview preparation (i)

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.