Compare, find, replace, split and intercept Java strings
Compare, find, replace, split and intercept Java strings
1, String comparison 1. equals(): case sensitive, and the return value type is boolean;
//Case sensitive comparison
String str1 = "hello" ;
String str2 = "Hello" ;
System.out.println(str1.equals(str2)); // Return false
2. Case insensitive: equalsIgnoreCase(), the return value type ...
Posted by phigga on Mon, 22 Nov 2021 16:03:36 -0800
The most powerful introductory tutorial of SpringBoot takes you quickly into the world of SpringBoot
SpringBoot tutorial
01 introduction
1.1 how spring simplifies development
Lightweight and minimally intrusive programming based on POJO, everything is bean;Loose coupling is realized through IOC, dependency injection (DI) and interface oriented;Declarative programming based on AOP and conventions;Reduce style codes through facets and templat ...
Posted by kelly3330 on Mon, 22 Nov 2021 15:49:53 -0800
Refactoring the player control bar using command mode
This article is excerpted from "design patterns should be learned this way"1 UML class diagram of command patternThe UML class diagram of the command pattern is shown in the following figure.2 reconstruct the player control bar using command modeIf we develop a player, the player has playback function, drag progress bar function, stop ...
Posted by ghjr on Mon, 22 Nov 2021 15:10:15 -0800
Multithreading
1. Three methods of creating threads
Inherit Thread class [key]
Inherit the Thread class, override the run() method, and call start to start the ThreadNot recommended: avoid the limitation of OOP single inheritance
//Method 1 of creating a Thread: inherit the Thread class, rewrite the run() method, and call start to start the Thread ...
Posted by pixeltrace on Mon, 22 Nov 2021 14:29:21 -0800
Pull hook education Java employment emergency training camp learning notes static keyword
Learning resources: Pull hook Education
Case Title: encapsulation and testing of People class
Program to realize the encapsulation of People class. The features include: name, age and nationality. It is required to provide a method to print all featuresThe PeopleTest class is programmed. The main method uses the parametric method to construct ...
Posted by groundwar on Mon, 22 Nov 2021 14:24:01 -0800
day06_ Object oriented (member variables, methods)
Overview of object-oriented thinking
Java language is an object-oriented programming language, and object-oriented idea (OOP) is a programming idea. Under the guidance of object-oriented idea, we use java language to design and develop computer programs. The object here generally refers to all things in reality, and each thing has its own attr ...
Posted by scoobydoo9749 on Mon, 22 Nov 2021 14:01:24 -0800
Explain the classic OJ questions of single linked list in detail
preface
This article is mainly about some classic related to linked lists in data structures OJ At the end of the paper, we also provide OJ The specific website of the question is for everyone to practice OJ I hope you can have a deeper understanding of the linked list. Finally, it is not easy to create. I hope you can give encouragement, prai ...
Posted by jtbaker on Mon, 22 Nov 2021 14:00:44 -0800
Notes on basic Java learning
1, Array
1. Declaration array
// Two ways to declare arrays
int array[];
int[] array2;// This is recommended
// Open up space
array = new int[3]; // Open up 3 spaces (array with length of 3)
// Note: after opening up a space, the default value of this type is saved
double[] array3 = new double[5];// Declare a double array of length 5
// Tw ...
Posted by k0z on Mon, 22 Nov 2021 10:51:35 -0800
Java in those let you love the manual tool library, refining the amount of code
Java in those let you love the manual tool library, refining the amount of code
1, New features of JDK1.8 Stream
1. Common generation methods of Stream
① Collections in the Collection system can generate streams using the default method stream()
//list to stream
List<String> list = new ArrayList<>();
Stream<String> ...
Posted by phppssh on Mon, 22 Nov 2021 10:08:01 -0800
Priority queue
1. Priority queue
1.1 concept
Queue is a first in first out data structure, but in some cases, the data operated may have priority. Generally, when leaving the queue, elements with high priority may be required to leave the queue. In this scenario, it is obviously inappropriate to use the queue. For example, when playing games on the mobi ...
Posted by killsite on Mon, 22 Nov 2021 07:27:01 -0800