1,917,413 questions
0
votes
1
answer
24
views
How to systematise a checking of "a quite equals to b" (either with round method or | a - b | ~ 0) for any value of a?
My context
I have implemented an equals(Object o) method for a speed object (Vitesse here) that when it faces a comparand being in m/s when it is itself in km/h (in example) puts the comparand in km/h ...
-2
votes
0
answers
21
views
Insert Data from Java to MySql
I don't know how to convert Java string numbers to insert them into MySQL table. The field 'peso' in MySQL is declared as float.
public void Conferma() {
// Creo un oggetto Prodotto
...
-7
votes
1
answer
27
views
How would you review and write these Java searchs, sorts and shuffling things? [closed]
I am cramming for a test and I would need help with learning some different java searching and sorting algorithms. The ones I have to know are:
Sorting:
Insertion sort
Merge sort
Selection sort
...
1
vote
1
answer
35
views
How to fix tab limit in BlueJ
I will be brief. Currently in BlueJ, if you print more than 3 tabs in a row, it will only print 3 tabs. you can see this with the following print statements (in Java):
System.out.println("\tX&...
0
votes
0
answers
21
views
Spring Boot 4 / Spring Security 6 – @WithMockUser returns 401 Unauthorized in MockMvc test
I’m setting up a project using Spring Boot 4.0.2 (Spring Security 6) and I’m getting a 401 Unauthorized in a MockMvc integration test, even though I’m using @WithMockUser(roles = "ADMIN").
I ...
2
votes
1
answer
53
views
Is there something wrong with commons-net-3.12.0.jar when I get java.lang.NoClassDefFoundError?
I got this crash report:
Exception java.lang.NoClassDefFoundError:
at org.apache.commons.net.SocketClient.disconnect (SocketClient.java:329)
at org.apache.commons.net.ftp.FTP.disconnect (FTP.java:...
3
votes
0
answers
67
views
Weird IllegalArgumentException - Spring 6.1 cannot find controller method parameters despite -parameters being passed in compiler
I have been observing a weird issue in my application. Recently we started observing a lot of exceptions of this type in our logs:
IllegalArgumentException: Name for argument of type [java.lang.Long] ...
3
votes
1
answer
94
views
Does function/method overriding occur only when polymorphism is implemented in java?
I am trying to clarify the relationship between Method Overriding and Polymorphism in Java.
From my understanding, overriding happens when a subclass provides its own implementation of a method ...
-3
votes
0
answers
45
views
Working download code gives "SocketException: Software caused connection abort" in Android 16 devices
I have an Android App that, among the other activities, makes API requests and downloads files.
It downloads a zip file with this code that never gives problems in past Android versions (...
-5
votes
0
answers
64
views
Selecting a random value from a Hashmap using ArrayList [closed]
Playing around with HashMap and learning how to organize it, but got stuck trying to print out a random value in my map. Used youtube Hashmap tutorial and this article to base the code. Selecting ...
0
votes
0
answers
25
views
Android on IntelliJ IDEA jlink.exe doesn't exist [duplicate]
In Intellij IDEA 2025, Android project, jlink doesn't exist,
> Task :app:compileDebugJavaWithJavac FAILED
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Could not resolve all ...
1
vote
2
answers
56
views
Confused over event coordinates reported and calculated from JScrollPane
In the following example code, we create a JFrame, a JPanel and a JScrollPane with which to view the JPanel, all put on the JFrame:
import java.awt.Dimension;
import java.awt.Point;
import java....
0
votes
0
answers
52
views
Android "Fragment already added" despite smart fragment management
I thought my code works well in terms of fragments management because I have tested it manually for a long time. Besides Crashlytics also didn't notify me that users are having any problem with it for ...
0
votes
1
answer
55
views
using Vertex AI Embedding in Spring Boot App
I intend using Google VertexAI Text Embeddings to embed text before saving in pgvectordb.
Pom.xml
<properties>
<java.version>21</java.version>
<!-- <spring-...
-2
votes
0
answers
51
views
Scalable image Upload using Spring MVC (Tomcat) [closed]
Requirement
I want a memory efficient way to upload images for scalability
I want to reduce the risk of high memory spikes during big loads. Therefore I initially had the plan to not store the whole ...