Recent Posts
-
java – ! list. Isempty() and list Size () > 0, same conditions?
I see such code if (!substanceList.isEmpty() && (substanceList.size() > 0)) { substanceText = createAmoun…… -
Java swing error ‘void’ type ‘is not allowed here
See the English answer > "'void 'type not allowed here" error (Java) 6 Code: public void create(JPanel jp){ jp.…… -
Java – regular expressions match 17 uppercase characters
In Java, which regex is more suitable for matching strings with a length of 17 characters? All strings are capitalized…… -
Splitting strings at specific locations in Java
Suppose you have a string in the form of "word1 word2 Word3 word4" The easiest way to split it is split [0] = "word1 w…… -
Get errors in C using vector and struct
What is the error in this Code: #include <iostream> #include <vector> #include <algorithm> using nam…… -
Java – create a method that can return two different contents
I'm trying to create a method that returns two different things based on the data type entered into it This class chan…… -
Java – when do I create a getter method without “get” in its name?
The following questions have bothered me for a long time. I can't find any information about naming conventions There …… -
Java – spring H2 embedded database
See the English answer > does spring embedded database support different SQL conversations? 3 MODE=MysqL DB_CLOSE_O…… -
Java – adds a command call to a UNIX command line application
I am writing a Solaris command line application using java 6 I want to be able to scroll through the history of previo…… -
Java – IIS 403 that prohibits the use of / in URLs
I have IIS (Microsoft IIS / 7.5) returned 403 Forbidden, I can't figure out why I narrow it down to / but only if it h…… -
Use Java 8 stream to parse CSV file
I have one CSV file, which contains the data of more than 500 companies Each line in the file refers to a specific com…… -
Convert foreach to a Java 8 filter stream
I have the following code Map<String,List<String>> map= new HashMap<>(); map.put("a",Arrays.asList("…… -
Java – Tomcat – learn about credentialhandler
I recently need to use containers to manage security and authentication >First, what about the credentialhandler de…… -
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 – Android retro fit: missing method body or declaration abstraction
I'm writing an Android application that will use retrofit to make API requests I have such a helper class: public clas…… -
Java – when we call a static final variable, why not execute the static block first
See English answers > static block in Java not executed class Test4 { public static void main(String as[]) { …… -
A better way to use Java 8
I convert the following code into Java 8 code I wonder if I'm doing it right or if there are other good ways Java 7 fo…… -
Set tooltips on all table cells in JavaFX
My application contains a tableview Change the row style by setting a custom cell factory with setcellfactory for this…… -
Java – decimalformat deletes zeros after a dot
I want to format the user's input, it doesn't matter, but when I try to delete it by clicking decimal format, I enter …… -
Dynamic – ownership tracking in rust: difference between box (heap) and t (stack)
Trying to use the programming language rust, I found that the compiler can track the movement of some structural field…… -
When they are Is java integer always = = when equals()?
See English answer > java: integer equals vs. = = 5 Integer x = 5; Integer y = x + 1; Integer z = y - 1; x.equals(z…… -
How do I check that characters are neither letters nor numbers in Java?
So I wrote some code in Java, and I tried to find out if there was a way to write a line of code to check that the cha…… -
Does Java – PostgreSQL support rest API?
I wonder if PostgreSQL supports rest, or are there other ways to implement it? Solution Postgres does not support out …… -
Java – null check using Date object [copy]
See English answers > java object null check for method 8 Solution Check if it is empty: if (date == null) {...} Ch…… -
Java – the best way to store locators
I'm focusing on Selenium's automated page object design pattern, and I can guess that many people store locators in Pr…… -
Why does Java enum need to check class and declaringclass in the CompareTo method
The type parameter E in enum is defined as < e extends enum < E > > So why do we need to check getClass ()…… -
Java – how do I replace multiple strings in one line?
I want to insert "ob" before each vowel I tried the following code: String out=txt.toUpperCase(); out=out.replaceAll(…… -
Java, item store discount math error
This program is designed to act as a store where numbers are entered for the corresponding items and quantities The pr…… -
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-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…… -
Cannot add an object of type T to the list in Java
I've been learning generics in Java Although I understand the concepts of type inference, parameterized classes and me…… -
Is it correct to infer that the default method is used in the interface to make it like an abstract class in Java?
Since we now have default methods in the interface, is it more like an abstract class using both abstract and non abst……