Java Community | Help. Code. Learn.

JCH

Java Community | Help. Code. Learn.

With more than 20,000 members, join one of the biggest and most active Java Communities on Discord! ☕

Join

java-help

❓︱qotw-answers

How long should it take at minimum for a person to learn this much for incoming semester exams ?

Following are the list of topics: 1. First Programming steps with Karel(methods, loops, conditions and first software engineering principles) and Top-down approach 2. Graphics Programming, classes of ACM Library, how to use objects...

mvn dependency:tree skips an transitive dependency

I have a problem according to maven. I have a module A, B and C. For legal reasons I am not allowed to tell the real names. Module A has a dependency to module B, module B has a dependency to module C. They are configured this way in the poms correctly. For some reason, if I call dependency:tree to the modul A, the module B is listed but the module C is not listed. Module A,B and C are in scope compile. They are of packaging "jar". The local repository is fresh. The group-ids for all modules are "x". The version for all modules is "1". Maybe exclusions are made, but I do not know where....

Use Case Diagram Question:

1. A customer uses a drink in the following way: he puts a coin in the drink collector parts, he selects the drink, he collects the chosen drink from the drinks tray and excess change in the change trap. Who is the actor in the system? Is it the drink, the coin collector, the customer, the drinks bin or the coin trap? ...

how do i unit test singleton classes in java?

specifically using mockito and junit

unit4

does someone know how can I download and use unit4 (node) in vscode?

Guice with empty Module

I'm learning Guice and I have working code, but my Module (extending AbstractModule) is empty (because I'm injecting a class not an interface). I can see that there's no overload of Guice.createInjector() which takes no params. Is there some way of not needing a module in my scenario? Not sure if: 1) it's not a big deal; you might add bindings to it later 2) using Guice with an empty module is an anti-pattern - always use interfaces (but I don't think that's correct) 3) I'm missing something....

make github actions build artifact public

https://github.com/asdru22/Game2D/actions/runs/12453995171 i have a jar that is built that i can download. however, only i can download it. how can i change it so that anyone can download it?...

build javaFX jar from github via maven

maven.yml: ```yml This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven ...

How would I hide a specific Character in a ListArray

Basically, i'm making a simple terminal file editor, which has basic syntax highlighting. I'm facing an issue where the character used for the 'cursor' (which is controlled by arrow keys) is fucking up the syntax highlighting. I use 2 variables which store its location (currentLine, and currentColumn), so how would I hide it or something off the syntax highlighting function? Code: ```java...

Help with interfaces/ inheritance

Hello im building a game where I'll have a board and GamePiece's that will be placed on the board, I have tokens, these can be placed on the board after some validation and they can't be moved once placed for the rest of the game I have totems, these will be automatically be placed in the center at the start of the game and they can be moved afterwards ...

How to set UUID as a primary key, and make an entry?

```java @Table("restaurant_group") public class RestaurantGroup extends Base { @Id...

Pig Latin Project Java

Hi, I've been working on my piglatin project but there seems to be an error with one of the conditions. I'm a beginner coder so I'm not really sure where I went wrong. I have a PigLatin and PigLatinRunner classes, the runner calls a translate method in PigLatin. Along with my translate method, I have boolean methods that check for punctuation. However, my output has a problem with counting punctuation. For example in a word string of money!" it only counts the quote on the right, but disregards...
No description

Modular Spring app can't find persistence provider

Hi, I'm trying to run my JPMS app through the command line instead of IntelliJ. I set up maven to copy all dependencies to a specified folder, so that they can be added to the module path. I use the following command to start the app: ``` java --module-path "infodb-app-1.0-SNAPSHOT.jar;modules" --add-reads ovh.eukon05.infodb.app=ALL-UNNAMED -m ovh.eukon05.infodb.app/ovh.eukon05.infodb.app.Main -Dinfodb.sources.articlelimit=5 -Dinfodb.hibernate.db.user=sa -Dinfodb.hibernate.db.pass= -Dinfodb.hibernate.db.url="jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1"...

Kotlin Branch Test coverage question

I have this line of code:
if (neighborhood.street.house?.family?.contains("Steve") == true) {
if (neighborhood.street.house?.family?.contains("Steve") == true) {
Test coverage is saying 1 out of 8 branches missed. But how in the world are there eight branches here??? IMO there are only 4 branches:...

Sequence allocation size question

Hi, I have a question on what my allocation size should be for my call to batch insert records into a table. I'm using sequence generator and I have a batch process that has to insert or update 50,000 records. I'm noticing the performance for this process isn't great and I read online I might need to adjust allocation size (currently have it as 1). So if I'm batch inserting in batches of 500 records, does that mean my allocation size should be 500?

I'm trying to get back to Java

Hello, I've been studying Java for a prolonged period of time, however, due to personal reasons & issues, I had to stop for a period of 5 months. Right now, my memory is really vague regarding several topics, what would you suggest to do? Is it better to start from the basics and build up again, or just hop into it & re-learn on the way?...
Next