Java
-
Java – find unpaired numbers in an array
I have an array that repeats all elements except one: int[] a={2,6,2,4,1,4}; How do I find unpaired element integers? …… -
IO stream technology
Create and delete files: createnewfile(), delete() Create folders: mkdir() and mkdirs() List next level: lists the sub…… -
How to resolve file names in Java?
I have a java file path /opt/test/myfolder/myinsidefolder/myfile. jar I want to replace the file path with the root pa…… -
Java – how to add padding using container?
I tried to do some padding at the top, but how do I use the container? JFrame frame = super.screen.getFullScreenWindow…… -
How to use Qt5 to realize multithreading (I)
#include "thread_one.h" thread_one::thread_one(QObject *parent) : QThread(parent) { } void thread_one::run() { …… -
The value of Java jsonobject array is key
I'm new to Java, so it's a little confusing I want to get a string in JSON format What I want is { "user": [ "name","l…… -
Java hashcode() string conflict
I know little about hash codes I found that this code can print out collisions Can you tell me what collision is and h…… -
Java – allocate memory using thread
I wonder what happens if a local thread is declared in a method? Usually, after the function returns, all local variab…… -
How to solve this Java lang.ClassCastException:org. apache. tomcat. dbcp. dbcp. Basicdatasource cannot be cast to org apache. tomcat. jdbc. pool. DataSource?
I tried to use pool for database connection in Tomcat. This is my context: <Resource name="jdbc/slingemp" auth="Con…… -
Java if() does not work
When I run some code (shown later), I tell it to check the string = = "1". If so, output "it is 1!", Otherwise, the st…… -
Java – which class is the superclass of all classes
I am a JAVA beginner I'm a little confused about the superclasses of all classes in Java? Solution From object documen…… -
Java and python ^ operators
For the CompSci class, we are looking at the Java math class As my stupid programmer, I try to use the ^ operator inst…… -
Java – scanner class hasnextline infinite loop
Why does this code enter an infinite loop when I try to give it a basic text file? import java.io.File; import java.io…… -
Java – what does “J” mean in a JApplet?
翻译错误 Invalid Access Limit Solution When sun started working on swing, they were like javax swing. Something like a…… -
Global sum error of multithreading in Java
I'm new to multithreading in Java. I made some code to see how it works I use global = 0 as the global int variable an…… -
Sorting point lists using java
See English answers > sort ArrayList of custom objects by property 25 Solution Yes, create a custom comparator and …… -
Java and windows – error: illegal escape character
I have finished changing registry data Java file But I'm running runtime getRuntime(). An illegal escape character err…… -
Java – Android runs the functions in the class in a new thread
I have this Code: MyClass tmp = new MyClass(); tmp.setParam1(1); tmp.SetParam2("Test"); tmp.setParam3("Test"); ... The…… -
RxJava`Completable. Andthen ` no continuous execution?
I have a use case. I initialize some global variables in a completable and use them in the next step of the chain (usi…… -
Java multi-level inheritance – protected instance variables in level 1 classes
I have a problem with multi - level inheritance in Java All three classes are in the same package I have class A: publ…… -
Java – a space saving data structure used to store and find a large number of (evenly distributed) integers
I need to find and find a million evenly distributed integers in memory Background: the above integer problem is a sim…… -
Java dot does not match “any character”
The dot should match any character So why doesn't this regular expression work? String url = "http://wikipedia.org"; S…… -
Java – math. In lambda expressions toIntExact?
I'm learning lambda expressions I did this: final static List<String> friends = Arrays.asList("Brian","Nate","Ne…… -
Java – compile Hadoop 2.2 0 work?
It seems that all the examples are built considering the old version How to compile my java program on Ubuntu so that …… -
Java – is my code too repetitive?
I'm studying my text adventure game and wonder if there's an easier way to write repeated code blocks, such as what I'…… -
How to set an infinite loop and break it (java thread)
I've set up a thread and I want to run it using a loop Therefore, this thread should run in the loop, interrupt within…… -
Java – how do I create a GUI in Android instead of using XML?
I don't like managing XML and Java together. Can I use the Java language to create the same GUI? Solution Yes, you can…… -
Java – Method println (int) in printstream type is not applicable to parameters (string, int, int, int)
public static void main(String[] args) { public static void main(String[] args) { int num1 = 1; int num2 = 1; …… -
Apply the function to each nth element in the vector
I have a vector in R: > v <- c(5,10,15,20,25,30,35,40,45,50) I want to apply a function to every Nth element of …… -
Java – is it possible to find out whether the value exists twice in ArrayList?
I have an integer ArrayList ArrayList <Integer> portList = new ArrayList(); I need to check whether I have enter…… -
Import the textfile and read it line by line in Java
I want to know how to import a text file I want to import a file and read it line by line thank you! Solution I don't …… -
Java double gets all numbers after dot / comma
This is a simple task, but I can't solve it myself I have double digit1 = 12.1; double digit2 = 12.99; And need a ……