Java string constant pool

Character string Literal amount of string: refers to the string itself, such as "Java", "Hello". String object: for example, new String("abc") or direct String s="str". The following "str" is also a string object. String reference: a reference is a variable that points to the corresponding stri ...

Posted by raw100 on Wed, 29 Jan 2020 04:59:03 -0800

Construction of [Netty] NioEventLoop

review stay Last section We have a general understanding of the creation process and function of threadpertakexcutor, but this is just to build an executor, which has not been really used yet, because before using, we need to build NioEventLoop, and the newChild method in this section is to do this. ...

Posted by tmyonline on Wed, 29 Jan 2020 04:50:07 -0800

Take you to know Mybatis interceptor and handwriting paging plug-in

The principle of Mybatis interceptor is a bit convoluted and simple. The principle is to implement agents for our customized interceptor class through the dynamic agent technology of JDK, and there can be multiple agents. Therefore, Mybatis interceptor will exist in the form of a chain, and each agent w ...

Posted by ctsiow on Wed, 29 Jan 2020 03:10:09 -0800

Test: OutOfMemoryError exception

Catalog 1, purpose 2. Practice (jdk8) 2.1 Java heap overflow 2.2 virtual machine stack and local method stack overflow 2.3 method area and runtime constant pool overflow 2.4 local direct memory overflow Reference resources 1, purpose Verify the contents stored in each runtime area described ...

Posted by ahmedkl on Tue, 28 Jan 2020 20:04:03 -0800

Java hidden problems

1. Comparison between basic type and reference type 1.1. Which of the following four variables is false Integer i01 = 59; int i02 = 59; Integer i03 =Integer.valueOf(59); Integer i04 = new Integer(59); (1) Integer in order to save space and memory, the number between - 128 and 127 will be cached in mem ...

Posted by MtPHP2 on Sun, 26 Jan 2020 00:06:15 -0800

Deep understanding of JVM class loading mechanism

Class loading process A type starts from being loaded into the memory of the virtual machine and ends at being unloaded. Its whole life cycle will go through seven stages: Loading, Verification, Preparation, Resolution, Initialization, Using and Unloading Collectively referred to as Linking, as shown in the figure: The order of loading, verify ...

Posted by sulin on Mon, 20 Jan 2020 03:17:20 -0800

HashMap source code analysis in JDK 1.7

We take jdk1.7.0_80 as an example to analyze the HashMap source code. Catalog 1, Source code analysis 1.1 important properties of HashMap 1.2 analytical PUT method 1.3 analyze resize method 1.4 parse GET method 2, Problem summary 2.1 how does the rounduptopower of 2 (toSize) method realize to find ...

Posted by Teck on Mon, 20 Jan 2020 02:07:08 -0800

netty creates and starts new thread process analysis

This article mainly shares the creation process of NioEventLoop thread bound by server socketchannel In the server startup process, when the registration operation is executed, it will determine whether the current thread is the thread in NioEventLoop bound by ServerSocketChannel. If not, it will encaps ...

Posted by scotthoff on Sun, 19 Jan 2020 22:49:35 -0800

Design mode of Dahua, decorator mode of structural mode

Overview of structural mode Overview of structural mode Decorator Pattern allows you to add new functionality to an existing object without changing its structure. This type of design pattern belongs to structural pattern, which is a wrapper for existing classes. This pattern creates a decoration cl ...

Posted by Slashscape on Sun, 19 Jan 2020 06:40:08 -0800

Application of reflection -- getting the structure of a class

Article directory 1, Get all interfaces implemented 2, Get parent 3, Get all construction methods 4, Get all methods 5, Get all attributes Reflection can not only instantiate objects, but also obtain the complete structure of a class. Three classes in java.lang.Class and java.lang.reflect package ...

Posted by chandan_tiwari on Sun, 19 Jan 2020 03:05:50 -0800