Recent Posts
-
Android: solve the problem of item click event after adding button in expandablelistview
After adding a button in expandablelistview, the item item item cannot be clicked, and the click event cannot be obtai…… -
On the strategy of thread safety realized by synchronized and volatile
What is thread unsafe My understanding of thread safety is that when multiple threads operate on a shared variable at …… -
Detailed explanation of thread pool of JUC package
Why use thread pools Architecture of JUC process pool Two methods of creating thread pool Seven parameters of thread p…… -
[Java interview eight part essay] JVM
1. Let's talk about the JVM memory model (runtime data area) The JVM memory model is divided into two parts: thread sh…… -
Enter an integer from the keyboard and judge whether it is positive, negative or 0
The code is as follows: import java. util. Scanner; Class demo7 {@ h_419_10 @ public static void main (string [] args)…… -
Calling exercise of construction method in word parent class
Person class: (parent class) Public class person {private string name; private int age; public person() {this ("Li Si"…… -
Programming to realize “electronic pet mall”
*/ The code is as follows: //Test class Public class demo {public static void main (string [] args) {dog H = new dog (…… -
Define author book class
Four classes are defined: Publishing House class (defining and displaying publishing house information), author class …… -
Byte stream copy file – byte stream
} Speed comparison between byte stream and byte copy: One 20m file: byte stream 70mm, byte 40000 mm -
Analog computer USB interface
//Computer class: /** computer class. The computer has a USB slot * / public class computer {private USB; / / indicate…… -
Collection framework – Landlords game
The code is as follows: import java. util. ArrayList; import java. util. Collections; import java. util. HashMap; /* *…… -
Find the difference set between two arrays
import java.util.ArrayList; public class array_diffrence { public static void main(String[] args) { Array…… -
Merge arrays using lists
import java.util.Arrays; import java.util.ArrayList; import java.util.List; public class array_merge { public sta…… -
Recursive call of exercise method
Five people sat together and asked how old the fifth person was? He said he was 2 years older than the fourth person, …… -
Multi branch practice lottery game, randomly generate two one digit random numbers, and prompt the user to enter the guessed number
The code is as follows: /*Multi branch practice lottery game, randomly generate two one digit random numbers, and prom…… -
Practice outputting the highest and second scores
The code is as follows: //Practice outputting the highest and second scores import Java util. Scanner; Class demo20 {p…… -
Delete array elements
import java.util.ArrayList; public class array_delete { public static void main(String[] args) { method_1…… -
Gets the number of uppercase letters, lowercase letters, and numbers in the specified string.
The code is as follows: import java. util. Scanner; /* * Gets the number of uppercase letters, lowercase letters, and …… -
Call the method to calculate the area of the rectangle
The code is as follows: import java. util. Scanner; Public class demo {public static void main (string [] args) {syste…… -
Configuring JDK environment variables in Windows 10 environment
1、 Environmental preparation windows10 jdk-10 2、 Download and install the JDK 3、 Configure environment variables 1.…… -
Practice complete employee classes
Employee class: /** employees* Extraction of commonness * name, number, working method (Abstract) * / public class emp…… -
Implementation of random roll call device
The code is as follows: /** random roll call: * 1 Store name * 2 Preview owner's name * 3 Randomly choose a person's n…… -
Several common sorting algorithms in Java
Several common sorting algorithms in Java 1. Sorting is the operation of arranging a string of records incrementally o…… -
Static internal class programming exercise
Outer class: Public class outer {int XX = 10; static int YY = 20; / / static inner class static class inner {int ZZ = …… -
Implement multithreaded thread
Define a subclass subthread to inherit thread: /** define subclasses, inherit thread * / public class subthread extend…… -
Define automobile engine class to output automobile information
The code is as follows: public class Demo { public static void main(String[] args) { // TODO Auto-generated method stu…… -
First acquaintance with Java
Theory Experiment [learning purpose] 1.) understand java 2.) create your first java project and be familiar with Java …… -
Thread pool-2
Subclass implementation interface: import java. util. concurrent. Callable; /* * The implementation class of callable …… -
Nesting of sets
The code is as follows: import java. util. HashMap; import java. util. Map; import java. util. Set; import java. util.…… -
Read text from character input stream FileReader class
import java. io. FileReader; import java. io. IOException; /* * The character input stream reads text files (only text…… -
Inherited programming exercises
Access the father class through son: The code is as follows: Father class: Public class father {/ / instance variable …… -
Practice judging the number of days in a month
The code is as follows: /*Enter a year and month, and output the corresponding days of the month * / import Java util.……