55 questions from the last 7 days
10
votes
3
answers
669
views
Why does Java byte[] to int/int to byte[] need operation "&0xFF"
I am trying to convert from byte[4] to int, and int to byte[4]. But why does java need the operation of (bytes[0] & 0xFF) thing? Because, you know, in bit level, when you are doing &0xFF, the ...
Advice
4
votes
13
replies
147
views
How to build strong fundamentals of programming without using AI
I am currently learning programming and I want to build strong fundamentals in subjects like logic building, problem solving, and understanding how programs actually work. However, I have noticed that ...
Advice
2
votes
8
replies
191
views
How can I determine whether a GitHub repository is suitable for first-time contributors?
I am a CS student with experience in C, C++ and basic Java.
When looking for open source projects on GitHub, I see labels like "good first issue", but I am unsure how to determine whether a ...
-3
votes
1
answer
200
views
Error: Class names are only accepted if annotation processing is explicitly requested [duplicate]
I built this calculator app so that it can calculate either the amount of paint to wall or the amount of thickness on a concrete slab for my APCSA class. When I tried to run it, however, I get this ...
Advice
0
votes
7
replies
169
views
I'm starting to learn Java. What is the actual way of saving information of my classes, when I only run the program in the Eclipse IDE?
Sorry for the question, I'm sure it's kind of dumb, but I am really new to this world. So I'm learning Java and I use Eclipse.
I've learned the most basic things, like classes, arrays, lists, and I'm ...
Best practices
0
votes
5
replies
100
views
Is it good design to use dynamic cast?
I am trying to implement password manager on Java right now. I am implementing the vault. I have VaultEntry and VaultFolder classes. VaultEntry has fields id, parentId, name, username, email, password ...
Best practices
0
votes
6
replies
108
views
Should I implement UserDetails directly in my User entity or create a separate UserPrincipal class in Spring Security?
I am building a Spring Boot application with Spring Security and JPA. I have seen two approaches for implementing UserDetails and I am confused about which one to use and why.
Approach 1:
@Entity
@...
0
votes
3
answers
101
views
How to call a method with generic parameter of a self referencing generic interface?
If given a generic interface of which generic is a reference to this generic interface itself, and this interface has a method with parameter as generic type. After implementing this interface with a ...
Advice
0
votes
1
replies
66
views
Client strict FIPS compliant (FIPS 140-3)
I’m looking into FIPS compliance of following clients :
Java clients using BouncyCastle FIPS Provider and BouncyCastleJSSE Provider
C++ clients using libcurl ( OpenSSL backend ) using OpenSSL fips ...
3
votes
2
answers
135
views
How to call a Spring @Service method before static initialization (before Spring context is fully loaded)?
I have a Spring application where I need to initialize a nodeId very early during application startup.
The problem is:
nodeId is used inside static blocks of some classes.
One of those classes is ...
3
votes
1
answer
134
views
Why does going back and foward with audio clips just stop them working?
So I am trying to make an audio player just because I want to understand stacks and GUIs in java better, I was expecting when a audio file was chosen it should have played which it did before but it ...
5
votes
1
answer
121
views
Mapping boolean to enum with Jackson
I need to deserialize a boolean YAML field into a enum and vice versa. The two have different names, too.
Importantly, there should be only one key for the Java field in the YAML ("darkTheme"...
1
vote
2
answers
126
views
Trying to get explosion to disappear after laser intersects with rectangle object
I am trying to make a little game in Java, where a Spaceship shoots a laser at a rectangle and the rectangle is removed and an explosion .png appears. The problem I am having is trying to make the ...
Advice
1
vote
5
replies
122
views
Oracle, PL/SQL and Java
I’m a PL/SQL developer with strong Oracle experience, interviewing for a role in a Java-based team. They’re happy with my database skills but want me to learn few Java skills before the next round.
...
-3
votes
1
answer
97
views
javax.swing does not exist [closed]
I'm doing a java OOP assignment and ran across a syntax error that shows JOptionPane does not exist on the import statement. How to fix that?