包含标签:Java 的文章
-
Configure Apache + Tomcat to support multiple applications, that is, multiple secondary domain names
1. Environment Apache2. 0.43. 0 Tomcat 4.1. thirteen mod_ jk-2.0. forty-three jdk 1.4 Windows 2003 Key file location: …… -
[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…… -
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…… -
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 …… -
Input a time from the keyboard and output its next second
The code is as follows: import java. util. Scanner; Class demo9 {public static void main (string [] args) {scanner SC …… -
Multi branch practice stone scissors cloth
The code is as follows: /*Multi branch practice stone scissors paper randomly generates a number of 0 / 1 / 2 represen…… -
Synchronous code block to achieve multi-threaded secure ticketing case
Class tickets implements the runnable interface: /** use the synchronization method to solve the thread safety problem…… -
Delete array elements
import java.util.ArrayList; public class array_delete { public static void main(String[] args) { method_1…… -
Array inversion
import java.util.ArrayList; import java.util.Collections; public class array_reverse { public static void main(St…… -
Enter the coordinates of two points from the keyboard to calculate the distance between the two points
The code is as follows: import java. util. Scanner; Class demo5 {public static void main (string [] args) {scanner SC …… -
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.…… -
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…… -
Thread pool-1
Subclass implementation interface: public class ThreadPoolRunnable implements Runnable { } Test class: import java. ut…… -
Method overloading
class MyClass{ int height; MyClass(){ System.out.println("无参数构造函数"); height=4; } …… -
Inherited programming exercises
Access the father class through son: The code is as follows: Father class: Public class father {/ / instance variable …… -
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…… -
Define a method to return the corresponding grade according to the score
import java. util. Scanner; } -
Inventory case – Set + method
The code is as follows: Commodity category: /** define and describe the class of the commodity * commodity: 4 attribut…… -
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…… -
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, …… -
Merge arrays using collections
import java.util.Arrays; import java.util.Set; import java.util.HashSet; public class array_union { public static…… -
Practice birth days
The code is as follows: import java. text. SimpleDateFormat; import java. util. Date; import java. util. Scanner; // C…… -
Nesting of sets
The code is as follows: import java. util. HashMap; import java. util. Map; import java. util. Set; import java. util.…… -
Merge arrays using lists
import java.util.Arrays; import java.util.ArrayList; import java.util.List; public class array_merge { public sta…… -
Array sorting, element search and element addition
import java. util. Arrays; public class array_sort { public static void main(String args[]) throws Exception{ …… -
This call between constructor methods
Person class: /** this can be called directly in the constructor * / public class person {private string name; private…… -
Thread pool-2
Subclass implementation interface: import java. util. concurrent. Callable; /* * The implementation class of callable …… -
Find the difference set between two arrays
import java.util.ArrayList; public class array_diffrence { public static void main(String[] args) { Array…… -
Thread waiting and wake-up cases
Define resource classes: /** define a resource class with two member variables * name, sex * and two threads to operat…… -
Define a method to find the maximum common divisor of two integers
import java. util. Scanner; /* * Define a method to find the maximum common divisor of two integers * / public class d…… -
First acquaintance with Java
Theory Experiment [learning purpose] 1.) understand java 2.) create your first java project and be familiar with Java …… -
Collection framework – Landlords game
The code is as follows: import java. util. ArrayList; import java. util. Collections; import java. util. HashMap; /* *……