包含标签:Java 的文章
-
On the classpath setting of Java
Original address: http://www.blogjava.net/macinter/archive/2006/10/19/76099.html The following is reproduced from sun'…… -
[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 …… -
Java realizes the addition, deletion, modification and query code of ES database
import com.alibaba.fastjson.JSONObject; import org.elasticsearch.action.bulk.BulkRequest; import org.elasticsearch.act…… -
Input a decimal number from the keyboard and output its binary number
The code is as follows: /*Input a decimal number from the keyboard and output its binary number * / import Java util. …… -
Array fill
import java.util.*; public class array_fill { public static void main(String[] args) { int array[]=new in…… -
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 angry birds (abstract classes, polymorphism, rewriting)
The code is as follows: //Birds: Public abstract class bird {/ / birds can fly, but birds of different colors can fly …… -
Find duplicate elements in an array
public class array_findDupicateInArray { public static void main(String[] args) { int[] array={1,2,5,6,7,9…… -
Practice using enumeration to display traffic light colors
The code is as follows: //Practice using enumeration to display traffic light colors class demo11 {public static void …… -
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…… -
Calculate current time
The code is as follows: /*Practice calculating the current time using system Currenttimemillis() calculates the curren…… -
Enter a grade from the keyboard and judge the grade corresponding to the grade (if branch statement)
The code is as follows: /*Enter a grade from the keyboard and judge the grade corresponding to the grade * / import Ja…… -
Input positive and auxiliary numbers from the keyboard, count the number of positive and negative numbers respectively, and calculate the sum of all numbers
The code is as follows: /*Input positive and auxiliary numbers from the keyboard, count the number of positive and neg…… -
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 …… -
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, ……