Category "java"

How to check if a player has collided with any wall Java

I am making a maze game and I am trying to implement a wall feature that will restrict the movement of a player if he collides with a wall. I have created a wal

Java "Catalan number" generator is almost working right

What a Catalan number is: https://en.wikipedia.org/wiki/Catalan_number I am doing some Java exercises and a couple of the test numbers aren't passing even thoug

Create object hierarchy with string prefixes

I'm working on a project where a REST endpoint responds with a flat list of objects. These objects have a String name, a String shorthand and a String structure

Create object hierarchy with string prefixes

I'm working on a project where a REST endpoint responds with a flat list of objects. These objects have a String name, a String shorthand and a String structure

How to use Eclipse collection in Spring boot ResponseEnity in Java

So I need help in using java eclipse collections as part of the response using the spring boot Response Entity JSON . I have tried using the generic way but I g

java.lang.NoSuchFieldError: com/fasterxml/jackson/annotation/JsonInclude$Include.USE_DEFAULTS

I am using spring 5.3.7 and when I start my application, it returns the error below: Instantiation of bean failed; nested exception is org.springframework.beans

java.lang.NoClassDefFoundError: javax/servlet/http/HttpServlet netbeans in netBeans

I'm developing a servlet that get a some detail from index.jsp form when i submit servlet throws following exception. I'm using NetBeans and Apache Tomcat/10.0.

Is there a way to enable inlay hints in VSCode for other languages like Java?

I noticed that inlay hints have been added to VSCode for TypeScript and JavaScript. I was just wondering if there was a way to enable it for languages like Java

Get current time without methods [closed]

I am trying to do it without methods so that I can better grasp the concept. I am really close. My hours math seems to be off. What am I not u

Getting "NumberFormatException" input string="" error and I don't know how to solve it [duplicate]

I'm trying to solve this question, but the NumberFormatException always happens. Using try-catch doesn't give me what I want because it always

The work manader's work is not controlled

I have a wok manager that I run from the Main Activity when the user logs into the application. So, I will tell you in more detail what I do in the manager: in

Why are singleton beans created twice in Spring?

I have a spring-boot project that contains a BookMapper bean: import org.apache.ibatis.annotations.Mapper; @Mapper public interface BookMapper { // some CR

Runnable inside synchronized (this) leads to app crash

My code is: @Override public void loadingDone(int whatIsDone) { if (interrupt) { return; } synchronized (this) { // 1 - loaded with v

How to convert JSON to Parquet in Apache Beam using Java

I am trying to convert Json Data {"col1":"sample-val-1", "col2":1.0} {"col1":"sample-val-2", "col2":2.0} {"col1":"sample-val-3", "col2":3.0} {"col1":"sample-val

Getting android.app.ForegroundServiceStartNotAllowedException in Android 12 (SDK 31)

I upgraded my apps targetSdkVersion and compileSdkVersion to SDK 31, and started receiving the following crash in app in a service that updates widget in backgr

Grayscale PNG writing from BufferedImage using PNGJ - hightest-level approach

I just want to, at first, use PNGJ at the highest possible level to write a grayscale PNG with bit-depth 8. I am working from a BufferedImage. Here's a snippet

How to create a folder and save files in root directory from api 30 android?

note: when I say root, I mean the folder where the download, documents, music, android folders are located, etc… Environment.getExternalStoragePublicDire

Multithreaded EJB client

I would like to parallelize multiple ejb calls from a java client and maintain a single transaction. the ejb is exposed on an websphere application server, and

Is there a way to get the EntityManagerFactory on a project that uses Java Spring JPA but doesn't have a "persistence.xml" file?

I want to use the EMF to do queries constructed at runtime on a String. If there is a way I would appreciate it if someone could tell me how and give a small ex

How to check if a correct character was entered by a user in a string in java?

I'm trying to write a code that would let me check if the item inputted by the user is valid. The item has a format of: NNN-LL-NNNNNN, where N is a number and L