包含标签:Java 的文章
-
Analysis and solution of failure of struts 2 date conversion on win10
New win10 operating system with ie11 and edge. A project developed uses struts 2, which has no problem running develop…… -
[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…… -
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)…… -
Practice defining class student classes
The code is as follows: (use member variables defined in other classes in one class) package demo04; /* * Define class…… -
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…… -
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 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)…… -
Interface exercises, teacher student
Working class: /** encapsulate this function in an interface * / public interface working {void sendad(); / / the meth…… -
Find the odd sum of any two number ranges
The code is as follows: /*Find odd numbers such as any two number ranges and * / import Java util. Scanner; Class demo…… -
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…… -
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"…… -
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…… -
Date class and its methods
The code is as follows: import java. text. SimpleDateFormat; import java. util. Date; Public class datedemo {/ / get t…… -
Serialization and deserialization of objects
Person_ Class 1: import java. io. Serializable; public class Person_ 1 implements Serializable { private String name; …… -
Practice complete employee classes
Employee class: /** employees* Extraction of commonness * name, number, working method (Abstract) * / public class emp…… -
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)…… -
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 ……