About concurrent HashMap from java7 to java8
Why use concurrenthashmap (the disadvantage of HashMap)
HashMap is the most commonly used Map class in Java. It has good performance and fast speed, but it can not guarantee thread safety. It can use null value as Key/value The thread insecurity of HashMap is mainly reflected in the dead loop when resizing and fast fail when using iterator In ...
Posted by McJepp on Sat, 19 Feb 2022 17:22:12 +0100
Section 13: simplify your code with Lombok
[TOC]In the development process, a large number of JavaBean s are usually defined, and then the constructor, getter, setter, equals, hashcode and toString methods of their properties are generated through the IDE. When adding properties or changing a property, such as naming and type, these methods mentioned above need to be regenerated. Such r ...
Posted by slushpuppie on Sat, 19 Feb 2022 17:11:18 +0100
Use Stream API to optimize Java code!
The new features of Java 8 are mainly Lambda expressions and streams. When streams and Lambda expressions are used together, the characteristics of stream declarative processing of data sets can make the code concise and easy to readHow to simplify the codeIf there is a demand, you need to process the dishes queried in the database:Select dishe ...
Posted by zvonko on Sat, 19 Feb 2022 17:11:52 +0100
Docker's one click deployment method of SpringBoot application is quick and easy for thieves to use!
stay Gradle can really kill Maven? Today I experienced it, thief cool In this article, we talked about using Gradle to build SpringBoot applications. These two days, we found another Gradle plug-in that supports one click packaging and push Docker images. Today, let's talk about this plug-in. I hope it will be helpful to you!
SpringBoot e-co ...
Posted by thaynejo on Sat, 19 Feb 2022 16:56:43 +0100
[single instance mode, multi instance mode, enumeration, factory mode]
day15 [single instance mode, multi instance mode, enumeration, factory mode]
Today's goal
Singleton mode ----- > must master
Hungry Han style single caseLazy single column Multi case mode ----- > must masterEnumeration ----- > must master
Define enumerationUse enumeration Factory mode ----- > must masterlombok plugin
Chapte ...
Posted by Slashscape on Sat, 19 Feb 2022 16:37:01 +0100
Lamdba03 Java 8 new feature 4: Stream API
Two major changes in Java 8 are Lambda expressions and Stream API expressions.
Stream is a key abstract concept for processing sets in Java 8. It can perform very complex operations such as searching, filtering and filtering on sets. Stream has also been added to the new version of JPA [connect database].
Stream API brings us powerful funct ...
Posted by able on Sat, 19 Feb 2022 16:15:58 +0100
A single example of design pattern
Singleton mode
Introduction to single example design mode
The so-called class singleton design pattern is to take certain methods to ensure that there can only be one object instance for a class in the whole software idea, and the class only provides a method to obtain its object instance (static method).
The singleton mode can be implemente ...
Posted by simonsays on Sat, 19 Feb 2022 16:03:46 +0100
Learning these API s of java is enough
Common API s
ava API is the classes provided to us in JDK. These classes encapsulate the underlying code implementation. We don't need to care about how these classes are implemented, we just need to learn how to use these classes.
There is a Src in the JDK installation directory Zip file. The contents of this file after decompression are ...
Posted by e33basketball on Sat, 19 Feb 2022 15:49:53 +0100
[project display] a little difficult number guessing game (written in Java)
(statement: some pictures in this article come from the Internet. If there is infringement, please contact us and delete or replace the pictures at the first time)
1. Foreword
I have uploaded some C language programs compiled in my undergraduate course and recently improved again in my blog. It has been some time. Good guy, if I don't do ...
Posted by Sevengraff on Sat, 19 Feb 2022 15:30:12 +0100
Kotlin advanced generic
We often use generics in Android development, such as List, Map, Set, Adapter, etc. generics are also supported in Kotlin. What is generics? Generics: special types that postpone the type specific work until the object is created or the method is called.
1, Defining generic methods in Kotlin
Defining generics in Kotlin is the same as Java in ...
Posted by mydog on Sat, 19 Feb 2022 15:11:00 +0100