Questions tagged [java]
Java (not to be confused with JavaScript) is a class-based, object-oriented, strongly typed, reflective language and run-time environment (JRE). Java programs are compiled to bytecode and run in a virtual machine (JVM) enabling a "write once, run anywhere" (WORA) methodology.
10,866
questions
1
vote
1
answer
31
views
One centralized class to wrap/manage OpenTelemetry
I am learning OpenTelemetry hands-on. I want to add OpenTelemetry manual instrumentation to my Java webapp, but I don't want to do import io.opentelemetry.api.* in ...
0
votes
0
answers
44
views
Dependency that emulates Spring JPA in Spring JDBC with save/saveAll and entities [closed]
I would like to know if someone could test a dependency that I created to facilitate work with JDBC by emulating the way JPA works with save and saveAll and entities in Java Spring.
The thing is that ...
2
votes
0
answers
42
views
Shrinkable Swing toolbar
I was tasked with implementing a toolbar that can be shrinked beyond what's necessary to display its buttons' texts. As a last resort, the buttons should hide their texts and only display their icons
...
1
vote
0
answers
25
views
Java multithreading with Spring JPA
I have to improve a process that is currently sequential, and i wanna make it multi-thread.
This process uses Spring JPA, with spring boot 2 and java 17.
I would like to have a feedback on the ...
3
votes
1
answer
392
views
Java: Benchmark findFirst() and findAny() methods on non-parallel streams
I would like to know how representative the following benchmark is? Can we infer from it that findFirst is much slower than ...
4
votes
2
answers
841
views
A chess engine in Java: generating white pawn moves - take II
Intro
This post continues the A chess engine in Java: generating white pawn moves.
I was advised to choose between efficiency and type safety. Since this is my first attempt at a chess engine, I have ...
8
votes
4
answers
2k
views
A chess engine in Java: generating white pawn moves
(This post has now a continuation.)
I decided to embark on implementing my own chess engine. The first (and perhaps most demanding) part of that endeavour is generating child states out of a given ...
2
votes
2
answers
70
views
A thread-safe performant Money Transfer API in Java
This is a popular interview question. It is meant to be done within 30 minutes. The task is to implement a thread-safe performant Bank Account API that allows to transfer, deposit, withdraw and check ...
3
votes
1
answer
94
views
Auth0 Credentials Manager in Android app
I am building an Android app that communicates with a REST API using Retrofit2 and uses Auth0 for authentication. The Android app needs to store access token from Auth0 and use it to authorize its ...
1
vote
0
answers
52
views
Principal Variation Search (PVS) for playing Connect Four in Java
This time, I have an implementation of PVS (Principal Variation Search) algorithm for playing the game of Connect Four.
The repository holding the above .java file ...
3
votes
2
answers
158
views
First tic tac toe game. want to see if valid or needs improvement
Just finished my first java class that taught me all the way up to oop and abstract classes. Decided to start some projects over the summer. Started with tic tac toe since it sounded fairly easy to do....
7
votes
3
answers
636
views
Simple calendar in Java
I set out trying to use as many methods as possible in order to use them in future projects, but I don't feel like I did a great job in regards to that.
Also i wanted to use as many basic java ...
1
vote
0
answers
40
views
Negamax with Alpha-beta pruning for playing Connect Four in Java
I have this repository.
My main concern this time is my implementation of the Negamax algorithm with alpha-beta pruning:
...
4
votes
1
answer
87
views
Multithreaded Alpha-beta pruning for playing Connect Four in Java
Intro
(The entire repository is in GitHub.)
This time, I have parallelized the famous Alpha-beta pruning algorithm. The idea is that the parallel algorithm descends in a game tree (at least) 2 levels ...
5
votes
1
answer
93
views
ConnectFourFX.java - A Java FX GUI app for playing Connect Four against AI
GitHub
The entire project relies here (ConnectFourFX.java) and is dependent on Connect4.java.
Code
com.github.coderodde.game.connect4.ConnectFourBoard.java:
...