Category "java"

GET REQUEST does not return faculty data properly causes 500 Internal Server Error

I'm trying to return the faculty data with it's corresponding students, professors, subjects and grade, I get this Error 500: I want postman to return this: to

How to make React Native Component background transparent?

I am using Tab Navigation which contains two screen, I need to make the background of each screen transparent so the app background is visible. This is how it l

Build android error at stage app:mergeDebugResources, ParseError AttributeNSNotUnique

I've been trying to build my Android Application on Android Studio 4.2 with Gradle 4.2.1, but I am faced with the following error of which I was only able to fi

"java.lang.ExceptionInInitializerError" error in RestAssured post request with body

I'm using restassured library and at the below line i'm getting "java.lang.ExceptionInInitializerError" error caused by "Caused by: java.lang.reflect.Inaccessib

Using 0 as Primary Key

I use lookup tables commonly and sometimes I have some default record in the Lookup table and I think for this record I can use 0 as Primary Key a as shown belo

In the postman I am getting proper json response but when I hit the service through restTemplate I am getting chinese characters

Code: RestTemplate template=new RestTemplate(); HttpHeaders headers=new HttpHeaders();

java.lang.VerifyError: class com.intellij.junit4.JUnit4TestRunnerUtil$5 overrides final method getRunner.()Lorg/junit/runner/Runner;

While running test cases from IntelliJ - facing this issue. mvn clean install works fine though. Anyone faced this issue before ?

How do I avoid NaN?

I understand it's because the program thinks I'm dividing by O, but I'm not sure how to fix it in the program. The program works fine, though. It outputs the av

handling back button android

I have a problem while hitting the back button on an activity, in particular, the back button on the activity closes the application and destroys all the activi

What's the difference between calling super.onCreate() and calling through to the superclass? [closed]

The following screenshot is from official Android documentation of android.app.Application#onCreate() which says If you override this method,

Java 8 Streams - How to get an equivalent of partitioningBy() with Integer keys?

In the code shown below, p is a predicate of type Predicate<String>. Map<Boolean, List<String>> partitioned = numbers.stream() .collect(Co

How do I return the final discounted price instead of the discounted amount off?

I am creating a method that takes a percent as a parameter and decreases the price by that percent. public void lowerPriceBy(double percent){ price = price/

Search all versions of a file in git log takes long

I noticed that finding all versions of a specific file in git takes a long time when the number of files in the repo is more then a couple of thousand. Any idea

Java - ATM Banking login with 3 times try pin lock

I'm new to java programming. I'm trying to make a banking system log-in that locks the user after entering the wrong pin 3 times. I'm trying to merge 2 pieces o

Apache Commons Configuration: read from classpath/JAR?

Does the Apache Commons Configuration library support reading properties/configuration files from the classpath or JAR? I didn't find an API where it can take a

Drawing multiple objects in Java [duplicate]

I would like to draw multiple objects like ovals, rectangles and lines together. But somehow I can draw only an object. When I try to draw ano

validate input in Thymeleaf

I have this input: Masa: <input type="number" class="form-control form-text" name="masa"/> <div class="text col-sm-12 error" th:if="${wzrost}"

Mutiple iterators in for loop Java not working properly

I am trying to pass a Javascript code to Java, but I've got a problem with the for loop, I have a for with 2 iterators in my Javascript code, and it is working

Calling a method to try and rerun through a block of code

I'm trying to compare the cost of a user's phone usage under plans from three different providers. I can get as far as entering the usage details but once enter

Change username and password for an existing Windows service in Java via Advapi32 (JNA API)

I have been trying to change configuration for an existing Windows Service via the JNA API, specifically via com.sun.jna.platform.win32.Advapi32 class but could