Talk about StringBuffer and StringBuilder

As we know, String is a read-only String. Once the referenced String is defined, it cannot be modified. Splicing or intercepting a String will create a new String object. If you need to make a lot of changes to the String, the performance of using String is extremely low. As an example, String is splice ...

Posted on Sun, 19 Jan 2020 09:42:23 -0500 by gth759k

Operator '= =' and object's equals() method

Operator '= =' and object's equals() method brief introduction The operator "= =" compares whether the two operands are equal. The two operands can be either basic type or reference type. For example > int a1=1,a2=3; > boolean b1=a1==a2;//The operand of "= =" is of basic ...

Posted on Sun, 19 Jan 2020 08:57:01 -0500 by megavolt

Java implements a simple interceptor through a dynamic proxy

1. Agency Before using dynamic proxies to implement interceptors, let's take a brief look at what Java proxies are. A proxy, as its name implies, does not directly operate on the object to which it is proxied (referred to below as the target object, which sounds more comfortable), but indirectly us ...

Posted on Sat, 18 Jan 2020 21:08:25 -0500 by smallflower

It's 2020, don't you study generics well?

I. overview Java generics is a new feature introduced in JDK 1.5. Generics provides a compile time type security detection mechanism, which allows developers to detect illegal types at compile time. 1.1 what are generics? Generic, that is, parameterized type. When referring to parameters, the most familiar thing is that there is a formal para ...

Posted on Sat, 18 Jan 2020 08:20:53 -0500 by ecco

Java web integration Cas single sign on

I. overview Now more and more systems provide a unified identity authentication single sign on mechanism. New applications can be easily integrated into existing systems only by integrating single sign on. Here we use Cas3.2.1 for demonstration, note: different versions of the configuration will be di ...

Posted on Sat, 18 Jan 2020 01:33:34 -0500 by Thoughtless

Three ways to implement the agent mode in JAVA

What is agent mode Agent pattern is a common design pattern in projects. Provides a way to indirectly access the target object; that is, through the proxy object to access the target object. The advantage of this is that you can add additional extension functions to the target object without changing ...

Posted on Fri, 17 Jan 2020 07:41:08 -0500 by slj90

CopyOnWriteArrayList data is written disorderly

CopyOnWriteArrayList problem This article records a problem that may cause data errors in CopyOnWriteArrayList, This problem was originally a conjecture when reading a book, but after verification, it was found that the problem existed. Originally, I thought that there would be no such problem since the jdk was on, but there was no such probl ...

Posted on Fri, 17 Jan 2020 06:48:45 -0500 by kateevanne

How to use AOP in SpringBoot

1. What is AOP AOP (Aspect oriented programming) is the complement and perfection of OOP (object oriented programming). OOP introduces the concepts of encapsulation, inheritance and polymorphism to build an object hierarchy to simulate a set of public behaviors. When we need to introduce public behav ...

Posted on Fri, 17 Jan 2020 04:22:10 -0500 by zleviticus

Spring: Spring AOP creation agent

1. beauties 2. overview Looking for agents, please refer to previous articles 3. Summary /** * Wrap the given bean if necessary, i.e. if it is eligible for being proxied. * @param bean the raw bean instance * @param beanName the name of the bean * @param cacheKey the cache key for metadat ...

Posted on Fri, 17 Jan 2020 03:23:40 -0500 by sundru

NIO synchronous and asynchronous blocking -- transition to netty (an asynchronous event driven network application framework)

BIO and NIO IO is in the form of synchronous blocking and NIO is in the form of synchronous non blocking. NIO does not realize asynchronous. After JDK 1.7, NIO library package is upgraded to support asynchronous non blocking Schoolmate model NIO2.0(AIO) BIO: synchronous blocking IO. The server impleme ...

Posted on Thu, 16 Jan 2020 08:43:13 -0500 by JennyG