About the intern method of String class in java
About the intern method of String class in java
Antecedents
During the review, I thought I understood the meaning of the String intern method when I wrote the section of common classes in notes, which is to return the address of the String constant in the String constant pool!
String s1 = new String("zs");
String s2 = s1.intern();
Syste ...
Added by kishanprasad on Sun, 20 Feb 2022 01:47:00 +0200
[prenatal education] java websocket server starting from 0
The full text is completed on the basis of IDEA compiler.
This article is for java beginners who have not learned all kinds of Java frameworks
Most java WebSockets on CSDN adopt the spring boot framework
This article does not use any framework related to spring, but only uses maven to import the websocket library
Reference source: https://g ...
Added by valtido on Sun, 20 Feb 2022 01:44:49 +0200
Implementation principle of ConcurrentHashMap ~java7
preface
Recently, when I read some articles about ConcurrentHashMap, I always said: before jdk8, ConcurrentHashMap used segment lock to ensure concurrency security. The jdk8 abandons the segmented lock and ensures the concurrency security through the sycronized keyword + CAS. Although it probably means so, it doesn't feel thorough enough, so I ...
Added by eatc7402 on Sun, 20 Feb 2022 01:35:51 +0200
It may be a little long introduction to Spring MVC, but learning may be wealth and freedom!
preface
As we all know, Java development is jokingly called spring development by the old oil subroutine apes, which shows the position of spring in Java development. If there is no spring framework, the code written by most people will be a shit.
Spring MVC is a very important module among the seven modules of spring.
MVC framework is a ful ...
Added by KingIsulgard on Sun, 20 Feb 2022 01:35:13 +0200
From introduction to mastery of JUC
catalogue
1 what is JUC?
1.1 introduction to JUC
1.2 concept of process and thread
1.3 thread status
1.3.1 thread status:
1.3.2 difference between wait and sleep
1.4 concurrency and parallelism
1.4.1 serial mode
1.4.2 parallel mode
1.4.3 concurrency
1.4.4 parallel
1.4.5 user thread and daemon thread
2 LOCK interface
2.1 synchroniz ...
Added by NeoPuma on Sun, 20 Feb 2022 00:08:02 +0200
HarmonyOS application development -- MyNotePad [note] [API V6] Based on TextField and Image pseudo rich text
1. Name
Name the app: MyNotePad and my notebook. The app icon adopts the default icon. Just set the app name. The project has been placed in gitee: MyNotePad
2. Function description
For Hongmeng application development API V6, it may not have rich text components. Read the relevant documents. Some functions of rich text components will n ...
Added by guestabc on Sat, 19 Feb 2022 23:52:37 +0200
Java learning notes - operators, loops, Number & Math class methods
Java operator
Conditional operator (?:)
variable x = (expression) ? value1 if true : value2 if false
Simply put, if expression is true, the value of x is assigned value1, otherwise it is assigned value2
instanceof operator This operator is used to manipulate an object instance to check whether the object is a specific type (class type or i ...
Added by ckk on Sat, 19 Feb 2022 23:44:50 +0200
One line of code to realize image thumbnail processing
Hello, everyone. I'm brother Qiang.
I wonder if you have ever used java to process pictures in your work. After graduating from college, brother Qiang was engaged in server-side WEB development and rarely contacted image processing. Most of those who have contact with pictures are the uploading and downloading of pictures. Therefore, I have li ...
Added by Cannibal_Monkey on Sat, 19 Feb 2022 23:01:19 +0200
Runnable, Callable, Future, FutureTask and Applications
Generally, there are only two ways to create a Thread: one is to inherit the Thread, and the other is to implement the Runnable interface. However, these two creation methods have no return value, and you have to use shared variables or other communication methods to get the results processed by the Thread.
It is generally not recommended to c ...
Added by endlyss on Sat, 19 Feb 2022 22:22:23 +0200
Stack and queue exercise sorting
catalogue
1, Bracket matching problem
2, Implement a minimum stack
3, Implement queue with stack
4, Implement stack with queue
4.1} implement stack with two queues
4.2 implementing stack with a queue
5, Design cyclic queue
6, Next larger element
1, Bracket matching problem
The title is described as follows:
Solution idea: use th ...
Added by kettle_drum on Sat, 19 Feb 2022 21:41:16 +0200