From entry to earth: Lambda's complete learning guide, package!

What is a Lambda expression Lambda expressions are an important new feature in Java SE 8.Lambda expressions allow you to replace functional interfaces with expressions.Like methods, lambda expressions provide a normal list of parameters and a body that uses them (which can be an expression or a block of code).Lambda expressions also enhance the ...

Posted on Tue, 10 Dec 2019 13:11:25 -0800 by motofzr1000

java implements thread safety by double checking or enumerating classes (lazy mode)

Double detection implementation /** * Lazy mode - > double synchronous lock single instance mode */ public class SingletonExample5 { private SingletonExample5() { } //volatile + double detection mechanism - > prohibit instruction reordering private static volatile SingletonExample5 instance = null; /** * sync ...

Posted on Sun, 08 Dec 2019 06:02:39 -0800 by arion279

The implementation of JDK and CGlib dynamic agent

The prototype of the application is Performer: Housing Agency (divided into JDKAgency and CGlibAgency) Represented object: Programmer Implementation interface of the proxy object: Tenant Tenement (no need to implement the interface when CGlibAgency) Tenement interface: package com.suzao.spring.test; /** * Tenement * @Description Tenant * @ ...

Posted on Sat, 07 Dec 2019 11:45:00 -0800 by vapokerpro

MyBatis multi-level agent programming implementation

Mybatis Proxy design pattern and programming principle Next, I will continue to write about multi-level agents in the previous article 1. Example explanation a. example introduction To realize a multi-level agent, mantis catches cicadas, and yellow finch is behind. Cicadas eat leaves, mantis eat cicadas, yellow finches eat ...

Posted on Sat, 07 Dec 2019 00:00:48 -0800 by mrwutang

Understanding of thread and synchronized lock

Program, process and thread I. concept understanding  Program: static code, blueprint of application software executionProcess: a dynamic execution process of a program, corresponding to a complete process from code loading, execution to execution.Thread: a smaller execution unit than a process. A process can generate multiple threads during ...

Posted on Fri, 06 Dec 2019 17:15:28 -0800 by wazo00

How much do you know about shallow and deep copies of Java?

This is a point of knowledge that we are discussing in the technical group today. The discussion is quite intense. Because there is less use of this area, there are some blind spots in this area.This article summarizes what has been discussed and hopefully this article will help you. In Java development, object copy or object cloning is a commo ...

Posted on Wed, 04 Dec 2019 23:55:25 -0800 by spyderman

Using thread pool and memory queue to deal with business problems asynchronously

background When there are a large number of the same tasks in the business of the system (such as sending a large number of mail), and the time of each task is relatively long, the front segment needs to respond quickly. For this demand, we can use message queue for asynchronous notification, and also use thread pool + memory queue for asynchr ...

Posted on Tue, 03 Dec 2019 16:11:48 -0800 by vlcinsky

Comparison of String and StringBuffer efficiency in splicing operation in Java

The String type is immutable in java, which means immutable. Every time String is spliced, it is actually a new String in the jvm. The more times String is new, the slower the virtual machine speed will be.The internal of StringBuffer is actually a character array. For different jdk s, you can use the following methods to view their actual size ...

Posted on Mon, 02 Dec 2019 19:21:10 -0800 by justcrapx

How do locks work? What are the precautions?

Common locks in Java are synchronized Reentrant lock java.util.concurrent.lock.ReentrantLock Repeatable read-write lock java.util.concurrent.lock.ReentrantReadWriteLock   There are three uses of synchronized Modify the common method, execute the method code, and obtain the lock of this of the object itself package constxiong.conc ...

Posted on Sat, 30 Nov 2019 09:37:53 -0800 by youknowho

Getting Started with JavaWeb - Installing Tomcat Server in a Windows Environment

Summary: This article mainly studies how to download and install Tomcat server in a Windows environment. download Get the installation package Recommend downloading Tomcat on the official website: https://tomcat.apache.org/ This download is the latest version of 9.0.29. You can also download the historical version in the following link: https:/ ...

Posted on Thu, 28 Nov 2019 12:05:45 -0800 by waseembari1985