HashMap is stored using Hash table. In order to solve the conflict of Hash table, open address method and chain address method can be used to solve the problem. HashMap in Java adopts chain address method. Chain address method, in short, is the combination of array and linked list. There is a linked list structure on each array element. When th ...
Posted by Jonob on Wed, 25 May 2022 18:02:25 +0300
In the morning, I saw the group of friends discussing the topic of where the Java string is. I was interested in the vegetable chicken who roughly witnessed the virtual machine, studied it and sorted out this blog
Where does the string exist
Here is a summary of what you agree:
If you use a constant method, the object will be stored in th ...
Posted by wipe on Mon, 16 May 2022 20:48:52 +0300
Java get time & the most complete summary of time formatting
Recently, I have encountered many problems in obtaining the current time in Java, and some have various requirements. Today, I will summarize the methods of obtaining time in Java and the formatting of time output.
This is the most commonly us ...
Posted by MHardeman25 on Sat, 14 May 2022 10:50:12 +0300
//The default initial capacity is 16
static final int DEFAULT_INITIAL_CAPACITY = 1 << 4;
//The default load factor is 0.75
static final float DEFAULT_LOAD_FACTOR = 0.75f;
//Hash array (initialized in resize())
transient Node<K,V> table;
//Number of elements
transient int size;
//Capacity threshold (if the number ...
Posted by HuggyBear on Mon, 25 Apr 2022 18:58:22 +0300
In java, thread pool ThreadPoolExecutor is a class that cannot be bypassed. It is the embodiment of the idea of sharing meta mode. It can be reused by creating a certain number of threads in the container, so as to avoid the additional overhead caused by frequent thread creation. A reasonably set thread pool can improve the speed of tas ...
Posted by suvarthi on Mon, 18 Apr 2022 17:26:44 +0300
The Spring Festival is at home, and sometimes I have to go out. When you go out, no computer can write code. So what if you get addicted to code? I wonder if I can write code on my mobile phone?
Mobile remote computer is a way, but remote development requires high requirements. First of all, you should have a computer that can be d ...
Posted by wtfsmd on Sun, 17 Apr 2022 14:50:29 +0300
We are all familiar with agency. If we have to give an example, for example, various intermediaries in life, such as the agent of star artists, are agents and agents in life.
There are agents in the world of programmers, and we are all very familiar with agent design patterns. For example, when it comes to spring framework, yo ...
Posted by fredanthony on Wed, 06 Apr 2022 00:07:49 +0300
Comparison of multithreading implementation and jdk1 8 feature completable future asynchronous programming
1, Review multithreading implementation comparison
There are three ways to implement multithreading:
Inherit Thread class
Implement Runnable interface
Implement Callable interface
Review the pros and Cons:
Posted by Mateobus on Mon, 04 Apr 2022 23:18:56 +0300
java source code analysis - internal classes
When we study the source code, we often see internal classes. In this film, let's learn the underlying principle of internal classes in detail.
What is an inner class
What is an internal class? Generally speaking, an internal class is a class defined inside a class. The internal class itself is ac ...
Posted by Trek15 on Sat, 26 Mar 2022 15:29:19 +0300