How many traversal methods does HashMap have? Which is recommended?

This article has included the interview selection series, Gitee open source address: gitee.com/mydb/interv... There are many HashMap traversal methods, and different JDK versions have different writing methods. JDK 8 provides three HashMap traversal methods, which breaks the embarrassment that the previous traversal methods are "very bl ...

Added by will on Thu, 09 Dec 2021 01:48:22 +0200

Static factory method of Java

Sequence: what is a static factory method Effective Java 2.1 the first advantage of static factory methods different from constructors is that they have names2.2 the second advantage is that you don't have to create a new object every time it is called2.3 the third advantage is that you can return subclasses of the original return type ...

Added by sudhakararaog on Wed, 08 Dec 2021 10:30:27 +0200

Some Tips in Kotlin development

Scope function selectionAt present, there are let, run, with and apply   and   also five scope functions.The official document has a table to illustrate the differences between them:    To sum up, there are several differences:1. apply and also return context objects.2,let,run   And with return lambda results.3. The ref ...

Added by liquidchild on Wed, 08 Dec 2021 02:36:55 +0200

Principle analysis of [Androidj advanced] Handler mechanism

Handler is an asynchronous callback mechanism provided in Android, which can also be understood as a message mechanism between threads. In order to avoid ANR, we usually put some time-consuming operations (such as network request, I/O operation, complex calculation, etc.) into the sub thread for execution. When the sub thread needs to modify th ...

Added by hucklebezzer on Tue, 07 Dec 2021 20:27:07 +0200

Elastic Certified Engineer review record - detailed explanation of review questions - search data

EXAM OBJECTIVE: QUERIES Test site: queries GOAL: Create search queries for analyzed text, highlight, pagination, and sort Test Objective: create search statements to analyze, highlight, page, and sort documents REQUIRED SETUP: Initialization steps: Suggested docker compose file: 1e1k_base_cluster.yml a running Elasticsearch cluster with a ...

Added by crazycoders on Tue, 07 Dec 2021 07:39:09 +0200

Summary of Java callback mechanism

In an application system, no matter what language is used for development, there must be calls between modules. There are several ways to call: 1. Synchronous call Synchronous call is the most basic and simplest way to call. Method a() of class A calls method b() of class B, waiting for the execution of method b(), and method a() continues ...

Added by rationalrabbit on Mon, 06 Dec 2021 23:59:32 +0200

A preliminary study on Cypress, a new upstart in Web automated testing

Recently, I wanted to learn about the web ui testing framework and found that cypress is easy to use. It is more convenient and faster to operate directly with js 01 development environment Cypress + nodejs (node has been installed before and can be downloaded and installed directly from the official website) + intellij idea 1. Install cypr ...

Added by Monshery on Wed, 01 Dec 2021 18:11:39 +0200

How to analyze Java problems from the perspective of bytecode

preface One day when i was wandering around Zhihu, i encountered such a problem: why is i the final result of face code 8? public static void main(String[] args) {  int i = 1;  i += i += ++i + 2.6 + i; } Very simple two lines of code. If you encounter such a problem, how will you explain the problem clearly? Is the formula disassembled by J ...

Added by echoninja on Tue, 30 Nov 2021 07:41:38 +0200

Dubbo's Troubleshooting: distributed service components of Spring Cloud Alibaba series

1. Distributed theory 1.1 basic definition of distributed Definition of distributed system principle and paradigm: "A distributed system is a collection of several independent computers that are like a single related system to users." distributed system is a software system based on network. 1.2 architecture development and evolu ...

Added by JonathanS on Tue, 30 Nov 2021 00:49:19 +0200

Finally understand why Spring Boot is so popular with HikariCP. This picture is too thorough

preface Now many companies are using HikariCP. HikariCP has also become the default connection pool of SpringBoot. With SpringBoot and microservices, HikariCP will be widely popularized. Next, Chen will take you to analyze why HikariCP can be invited by Spring Boot from the perspective of source code. The article directory is as follows: ...

Added by mwilson2 on Mon, 29 Nov 2021 16:17:09 +0200