Unit, Any and Nothing in Kotlin

Kotlin has some new things: Unit Any and Nothing, here is my understanding of these three brothers. Unit First, look at the definition of Unit in Kotlin: package kotlin /** * The type with only one value: the `Unit` object. This type corresponds to the `void` type in Java. */ public object Unit { override […]

SpringBoot statistics code execution takes time, and there are so many ways to play!

Click on the “Java base” above, select “Set as star” Be a positive person, not a positive waste person! Update articles every day at 14:00, lose a million bits of hair every day… Source code boutique column Original | Java 2021 Super God Road, very liver~ An open source project with detailed annotations in Chinese […]

Nanyou Cryptography Experiment 1 – Java

The code is relatively bad, and there are some strange bugs, just for reference package src; import lombok. AllArgsConstructor; import lombok.Data; import java.util.*; import java.util.concurrent.atomic.AtomicInteger; /** * Abstraction of geared machines * * @author zhou * @date 2023/2/28 */ @Data @AllArgsConstructor public class Gear { private LinkedHashMap<Character,Integer> forwardCharacterMap; private LinkedHashMap<Integer,Character> backwardCharacterMap; private LinkedHashMap<Integer,Integer> forwardBindMap; private […]

The @Autowired annotation is not recommended by Spring or IDEA, why are there so many people using it?

Default assembly for @Autowired We all know that the @Autowired annotation in spring is used to automatically assemble objects. Usually, we use it like this in our projects: package com.sue.cache.service; import org.springframework.stereotype.Service; @Service public class TestService1 { public void test1() { } } package com.sue.cache.service; import org.springframework.stereotype.Service; @Service public class TestService2 { @Autowired private TestService1 […]

Don’t use the main method to test anymore, it’s really too low…

Reply “Join the group” after paying attention, and pull you into the programmer exchange group From: Nuggets, Author: Richard_Yi Link: https://juejin.cn/post/6844903936869007368 Foreword “If you cannot measure it, you cannot improve it”. In daily development, we have many options for calling some code or using tools. When we are not sure about their performance, the first […]

Four ways to write Mybatise one-to-many association query

Mybatis one-to-many association query has the following writing methods: Use nested query (Nested Select): Use a subquery in the main query to convert the one-to-many relationship into two independent queries. After obtaining one data in the main query, obtain more data in the subquery. Finally the two results are merged together. The advantage of this […]

Java source code analysis Lecture 21: How to implement the message queue in Redis? How many ways are there?

If you are careful, you may have noticed that there are three classes in this series of courses that are all about message queues. In class 10, we talked about program-level message queues and the implementation of delayed message queues, and in class 15, we talked about common messages. Queue middleware RabbitMQ, Kafka, etc., which […]