Queue, Deque for collection, double-ended queue [ArrayDeque, LinkedList], priority queue [PriorityQueue]

Queues in the data structure know that the most important feature of a queue is that it can only access one element at the head and add one element at the tail.There is also a type called double-ended queue.You can effectively add or delete elements at the same time as the head and tail.Adding elements in the middle of a queue is not supported. ...

Posted on Wed, 13 Nov 2019 21:55:04 -0800 by Mortana

How to realize object clone and deep copy?

Implement the clonable interface and override the clone() method. If the clonable interface is not implemented, a CloneNotSupportedException exception will be reported. package constxiong.interview; /** * Test cloning * @author ConstXiong * @date 2019-06-18 11:21:21 */ public class TestClone { public static void main(Stri ...

Posted on Mon, 11 Nov 2019 12:15:45 -0800 by lprocks

[JDK] complete steps of Linux Installation source package JDK

[JDK] complete steps of Linux Installation source package JDK 1. Check the jdk version in the system [root@localhost software]# java -version Show: openjdk version "1.8.0_102" OpenJDK Runtime Environment (build 1.8.0_102-b14) OpenJDK 64-Bit Server VM (build 25.102-b14, mixed mode) 2. Check the jdk installation package [root@localhost software]# ...

Posted on Mon, 11 Nov 2019 06:11:58 -0800 by Stu

JAVA basic arrangement

LinkedList class The chain list container is also learned by comparing the jdk source code. 1. Define node type class Node<E>{ E item; Node<E> next; Node<E> prev; Node(Node<E>prev,E item,Node<E>next){ this.prev=prev; this.next=next; this.item=item; } Node(E item){ this.item=item; } } private stati ...

Posted on Sun, 10 Nov 2019 13:54:40 -0800 by gamerzfuse

Analysis of List and Set set Set series

Catalog List interface 1.1 List interface introduction 1.2 common methods in list interface Subclass of List 2.1 ArrayList set 2.2 LinkedList set Set interface 3.1 Set interface introduction Set interface subclass 4.1 introduction to HashSet set ...

Posted on Wed, 06 Nov 2019 17:01:02 -0800 by validkeys

JDK 1.8 nashorn engine use

I have sorted out some recent technical research on the project and hope to discuss and exchange with you. In the calculation module of liquidation project, nashorn, the js engine of jdk 1.8, is used for calculation Some simple tests have been done to nashorn in the process of using. Using nashorn to compile js and perform invokeFunction calcul ...

Posted on Mon, 04 Nov 2019 12:11:21 -0800 by arion279

ThreadLocal (sharing data in one thread)

ThreadLocal In the case of "transaction delivery Connection" parameter, we must pass the Connection object to complete the whole transaction operation. If we do not pass the parameter, can we do it? In JDK, we are provided with a tool class ThreadLocal. This class can share data in a thread Java.lang.thread local: this class provide ...

Posted on Mon, 04 Nov 2019 12:09:12 -0800 by theorok

RocketMQ 4.5.1 building a dual master and dual slave asynchronous replication environment

Basic environment Operating system: CentOS7 Example: 192.168.63.129192.168.63.130192.168.63.131192.168.63.132 Java: jdk-8u191-linux-x64.tar.gz Install JDK First, unload the system   [root@localhost soft]# rpm -qa|grep java python-javapackages-3.4.1-11.el7.noarch java-1.8.0-openjdk-1.8.0.181-7.b13.el7.x86_64 java-1.8.0-openjdk-head ...

Posted on Mon, 04 Nov 2019 10:54:46 -0800 by grilldan

Design pattern (02): static agent, dynamic agent, adapter

I. static agent mode Proxy mode: provides a proxy for other objects to control access to this object. In essence, the agent pattern is the representative of "real object". It introduces a certain degree of indirectness when accessing objects, because this indirectness can be used for many purposes. Specific scenario The operator queri ...

Posted on Mon, 04 Nov 2019 01:51:35 -0800 by guarriman

Figure introduction and installation of Neo4j database

Neo4j is the leader of today's market graph database. It has enterprise level functions such as scalability and high availability. It is the best choice to meet our needs. What kind of problems does graph database solve? Why Neo4j? Relational databases can't handle relationships well NoSQL database does not process relationships Ne ...

Posted on Fri, 01 Nov 2019 03:26:01 -0700 by youqing