包含标签: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 …… -
Abstract classes are used as parameters and return values of methods
Abstract class animal: public abstract class Animal { public abstract void eat(); } Subclass cat: Subclass dog: Public…… -
Define a date class: including three member variables: year, month and day, and the method of displaying the date
*/ The code is as follows: public class Demo { public static void main(String[] args) { Date date1=new Date(1994,5,22)…… -
About troubleshooting: the main class cannot be found or loaded. Reason: Java Method of lang.classnotfoundexception
The JDK is configured and the code @ h is written_ 419_ 1@ @H_ 419_ 1@ @H_ 419_ 1@ javac Hello. Java also successfully…… -
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…… -
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 …… -
Calculate current time
The code is as follows: /*Practice calculating the current time using system Currenttimemillis() calculates the curren…… -
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 …… -
Array inversion
import java.util.ArrayList; import java.util.Collections; public class array_reverse { public static void main(St…… -
Thread pool-1
Subclass implementation interface: public class ThreadPoolRunnable implements Runnable { } Test class: import java. ut…… -
Define a method to return the corresponding grade according to the score
import java. util. Scanner; } -
Merge arrays using collections
import java.util.Arrays; import java.util.Set; import java.util.HashSet; public class array_union { public static…… -
Array sorting, element search and element addition
import java. util. Arrays; public class array_sort { public static void main(String args[]) throws Exception{ …… -
Thread waiting and wake-up cases
Define resource classes: /** define a resource class with two member variables * name, sex * and two threads to operat…… -
Practice outputting an integer in reverse order
The code is as follows: /*Practice outputting an integer in reverse order, and take out the numbers of bits, tens, hun…… -
Interface as a parameter and return value of a method
Interface smoking: public interface Smoking { public static final int a=1; public abstract void smoking(); } Student c…… -
Practice calculating different types of car rentals
The code is as follows: Vehicle class: Public class vehicle {/ / return the total rent public double getsum (int days)…… -
Interface exercises, teacher student
Working class: /** encapsulate this function in an interface * / public interface working {void sendad(); / / the meth…… -
Date class and its methods
The code is as follows: import java. text. SimpleDateFormat; import java. util. Date; Public class datedemo {/ / get t…… -
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. …… -
Find duplicate elements in an array
public class array_findDupicateInArray { public static void main(String[] args) { int[] array={1,2,5,6,7,9…… -
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…… -
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…… -
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 …… -
Method overloading
class MyClass{ int height; MyClass(){ System.out.println("无参数构造函数"); height=4; } …… -
Inventory case – Set + method
The code is as follows: Commodity category: /** define and describe the class of the commodity * commodity: 4 attribut…… -
Practice birth days
The code is as follows: import java. text. SimpleDateFormat; import java. util. Date; import java. util. Scanner; // C…… -
This call between constructor methods
Person class: /** this can be called directly in the constructor * / public class person {private string name; private……
