包含标签:Java 的文章
-
Java – build executables from different jars
I wrote a program that contains various Java libraries used in the program I used NetBeans to make the jar file of my …… -
Lambda – iterates over two lists using a Java 8 stream
How do I write the following in a Java 8 stream? int total = 0; for (ObjectA obja : rootObj.getListA()) { for (O…… -
How to make Java wait for user input
I'm trying to make an IRC robot for my channel I hope the robot can get commands from the console In order to make the…… -
Java – why is the difference between specific dates (03 / 12 / 2018) not the exact number of days?
I'm facing a strange problem with Java (versions 6, 7, 8) In this code, I try to calculate the date difference between…… -
Java – spring data JPA cannot be configured: the specified class is an interface
I have started using spring data JPA Unfortunately, I can't configure it I have entity class and repository interface,…… -
How to create a string representing Java as if it were an unsigned 64 bit value
My component was passed a long value, which I later used as a key in the cache The key itself is a string representati…… -
The Java iterator gets the next one without incrementing
I write the following loop in Java for each loop that I want to access the current and next elements of the link list …… -
How to cut the Java of each loop in half?
I'm working a lot for each loop in Java I'm using them to "draw" every class of my object, but it requires a lot of me…… -
Java – how to invert large arrays?
OK, so I know it's very easy to reverse the array by swapping items until you reach the middle like this: int array[SI…… -
Java-8 – three possible Java 8 optional values – how do you cleanly return any existing?
See English answers > teaching options in Java 8 5 return optionalA.orElseIfPresent(optionalB).orElseIfPresent(opti…… -
Avoid using global variables in Java 8 stream reduce methods
I'm trying to use Java 8 to rewrite the implementation of Moore's voting algorithm to find the major elements in the a…… -
Java – does the playframework return absolute URLs in HTTP instead of HTTPS?
I'm using only HTTPS in nginx play! A project is implemented in the framework Everything is normal, SSL is recognized,…… -
Lambda function in Java 8 has no parameters and return values
I want to transform a simple Java function into a lambda 8 function without any parameters, and then call it: public i…… -
Java – why must variables be initialized?
Here, I try to get the output month by entering the number of months, but why do I make a mistake Why must monthstring…… -
Switch statement found in Java method Does the method need to return something?
I was reading some Java textbooks trying to learn a new language, and I encountered this method private String monthNa…… -
Java – @ suppresswarnings annotation benefits
@Is the suppresswarnings annotation for clearer code, or is there any performance improvement or advantage by adding i…… -
Java – how to dynamically get fields from POJOs
The following is my POJO class, which has 50 fields with setters and getters Class Employee{ int m1; int m2; int m3; .…… -
JavaFX callback lambda expression
So I'm trying to update the old JavaFX application I created on the Java 6 release I got a hint that I can convert the…… -
Java – how to print the largest number in a map
I'm reading a map in Java I want to browse a map with different numbers and print out the three largest numbers in the…… -
Java – this method standard uses varags Length instead of Boolean?
I call this method many times in many places: private String changeFirstCharCase(String word) { return Character.t…… -
Java cache array length calculation in loop
See English answer > what is the cost of calling array Length 8 int[] someArray = {1,2,3,4} for (int i = 0; i <…… -
Java – compare the efficiency of two o (n) algorithms
I'm studying linked lists, and the problem is - write a function to print the middle items of a given linked list (ass…… -
Java – Maven integration test cannot find my class in the same package structure
This is my file: POM parents: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/…… -
I want to use string in Java Replaceall (regex, regex) instead of (regex, string)
Example: input = "10N10N"; input = input.replaceAll("1|N","N|1"); // Syntax not correct Expected output: n01n01 What I…… -
What is the purpose behind the static final field in the Java – collections class?
The collections class has three static final fields named empty_ LIST,EMPTY_ Map and empty_ SET. They are all interfac…… -
Java – Tomcat – learn about credentialhandler
I recently need to use containers to manage security and authentication >First, what about the credentialhandler de…… -
The value passed by Java is explicit
See English answer > is java "pass by reference" or "pass by value"? 78 Cell boardGame[][] = new Cell[8][8]; I need…… -
java – ClassCastException:org. springframework. orm. jpa. Entitymanagerholder cannot be cast to org springframework. orm. hibernate5. SessionHolder
I tried to create a simple user login and registration page But I can't create users using the service method @Service…… -
Java – how to simulate an actor based on actorselection?
I have searched a lot about this, but there is no answer I have an actor "a" (user / a). When I receive the message "m…… -
Java-8 – Java prevents a lot of if and replaces it with design patterns
I use this code in my application and I find it very ugly for (final ApplicationCategories applicationCategorie : appl…… -
Java – spring resttemplate send list get list
I want to use spring's resttemplate to provide services. In terms of my services, the code is as follows: @PostMapping……