JAVA class set source code analysis and Implementation -- Map

HashMap The underlying structure is hash table, which uses the way of array + linked list; the storage address of the same linked list is the same; Each node of the linked list is an Entry object with four parts: hash, key, value and next Add an element, not to the back of the list, but to the front of the list Advan ...

Posted by acabrera on Sun, 03 Nov 2019 08:16:03 -0800

Analysis of super detailed Java producer consumer pattern

Producer consumer pattern is the most common pattern in multithreading: producer thread (one or more) generates bread and puts it into basket (set or array), while consumer thread (one or more) takes bread consumption out of basket (set or array). Although their tasks are different, the resources they process are the same, which embodies a way ...

Posted by ThYGrEaTCoDeR201 on Sun, 03 Nov 2019 06:15:07 -0800

Java ArrayList underlying implementation principle source code detailed analysis of Jdk8

brief introduction ArrayList is a dynamic array based on array. Its capacity can grow automatically. It is similar to the dynamic application memory and dynamic growth memory in C language. ArrayList is not thread safe and can only be used in a single thread environment. In a multi-threaded environment, you can consider using the collections. ...

Posted by Zjoske on Sun, 03 Nov 2019 01:02:52 -0700

Java Road -- Day15(Collection class)

2019-11-01-22:09:09 Catalog 1. Concept of collection 2. Common methods of collection collection 3.Iterator iterator 4. Enhance for 5. Common collection tools The concept of Collection collection ● set: set is a container provided in java, which can be used to store multiple data. Since sets and arrays are containers, what's the differ ...

Posted by readourlines on Sat, 02 Nov 2019 23:03:01 -0700

Java design pattern series - sharing element pattern

​ I. overview Sharing mode: "sharing" is the meaning of sharing, which means that one thing is shared by all, and this is the ultimate purpose of the mode. Sharing element mode is similar to singleton mode in that only one object is generated to be shared. There is a problem here, that is, the modification of shared objects. In order ...

Posted by jaql on Sat, 02 Nov 2019 21:53:11 -0700

Reading messages of Netty source code analysis

The server gets the read event, and the network module starts to read the message public final class NioEventLoop extends SingleThreadEventLoop // Also check for readOps of 0 to workaround possible JDK bug which may otherwise lead // to a spin loop if ((readyOps & (SelectionKey.OP_READ | SelectionKey.OP_ACCEPT)) ! ...

Posted by Germaris on Sat, 02 Nov 2019 20:26:38 -0700

7. Spring's in-depth understanding of AOP source code

Spring's in-depth understanding of AOP source code In the last blog post, we have a preliminary understanding of AOP, so next we will conduct in-depth analysis on the implementation principle of AOP. In the AOP sample code written before, there is such a note: @ EnableAspectJAutoProxy. The purpose of this note is to enable the AOP function, so ...

Posted by dgreenhouse on Sat, 02 Nov 2019 13:07:35 -0700

Interpretation of ArrayList source code

Interpretation of ArrayList source code attribute private static final int DEFAULT_CAPACITY = 10;//Default initialization space private static final Object[] EMPTY_ELEMENTDATA = {};//Empty array for empty object initialization private static final Object[] DEFAULTCAPACITY_EMPTY_ELEMENTDATA = {}; transient Object[] element ...

Posted by The_Assistant on Sat, 02 Nov 2019 11:09:12 -0700

Links to native methods

A simple JNI demo was given earlier. Let's review: package diveinjvm; public class Foo { // public static native void foo(); // public native void bar(int i, long j); public native void bar(String s, Object o); int i = 0xDEADBEEF; public static void main(String[] args) { ...

Posted by skateme on Sat, 02 Nov 2019 01:03:47 -0700

[CentOS] JDK installation and deployment

Catalog JDK installation and deployment I. software version II. JDK installation 3. Uninstall openjdk JDK installation and deployment I. software version JDK version: jdk-7u79-linux-x64.tar.gz Other: Linux Distribution: CentOS-7-x86_64-DVD-1804.iso FTP Tools: FileZilla_3.32.0-rc1_ ...

Posted by goldfiles on Thu, 31 Oct 2019 15:16:18 -0700