Category "java"

Sort List<Object> by month name in Java

I am having following data in ArrayList in Java. I am trying to sort it by month in a year. It should sort by December, November, and so on. I have tried differ

What is a NullPointerException, and how do I fix it?

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them? What methods/tools can be used to determine the cause

Java Error: illegal start of expression

I'm basically refining, completing and trying to compile a test code from a reference book for java beginners. The objective is to create a guessing game wherei

Cmd is not showing Java Version

I am running for Java -version & javac -version in my cmd, but it isn't showing any output. It just goes to the next line, and doesn't show anything. Can an

org.testcontainers.dockerclient.DockerMachineClientProviderStrategy - docker-machine executable was not found

When I try to run test containers I get the following error. The docker machine not found in /root/.sdkman/candidates/gradle/current/bin, /usr/local/sbin, /usr

Java Array Odd Sorting Algorythm

I got an algorithm to write that set order of an Arrey but in a specific way. Find the lowest number of an array Save it at the start of the new array. Mark in

How can I limit the number of webelements in a list using Selenium and Java

I have this number of list from the following dom, There are total 10 elements. I want to store the first 5 elements from the list in a variable. How can i do i

How do I un-install a specific open jdk 1.8.0_322 which I suspect was installed using homebrew. All my trials have failed

I need to un install my JDK 1.8 version from my Mac 12.2.1 Montere. However much I try I could not get rid of it. When I run $ java -version, I get openjdk vers

Adding a custom Swing component in a JFrame

I've created a simple JTextField (this will have a mask after and I'll use this in multiple projects) and I'm trying to add in a simple JFrame, however, when I

Why my lambda is not applicable for comparator?

At first, I write the following code, but it can't build. Arrays.sort(n, (o1 ,o2) -> o1 % 2 == 0 ? 1 : -1); enter image description here And then , I write a

How can i make for loop a recursive method

How can I make this code a recursive method? for (int i = 3; i < arr.length; i++) { writer.write(arr[i] + "\n"); strout += arr[i] + "\n"; }

How to update Rcyclerview after removing an Item from shared preferences

I have a few recyclerview in different activities and all of their items specified by sharedpreferences but after removing an item from sharedpreferences the re

JFrame not "disposing" on actionperformed method

Background: I am creating a login browser page before my main UI(myGUI) page is displayed. I am using a HashMap to store the correct username and password combi

How to set up multiple HTTPS connections in Java

I'm using HTTPS to connect to web services. The problem is that I need to connect to 2 web services and then they have different certificates. In this class the

Java Stripe : How to Complete an "Incomplete" Payment

I'm using PaymentIntent to make a payment. I specify the customer that has all the billing info, but the payment is specified as "Incomplete", I checked this ST

In Java, how does BitSet get range works?

pls help me with below code snippet understanding /*package whatever //do not write package name here */ import java.io.*; import java.util.BitSet; class GFG {

Gradle sync failed: Plugin [id: 'com.android.application', version: '7.1.2', apply: false] was not found in any of the following sources:

I have upgraded my Android Studio and after that I'm facing this error: Gradle sync failed: Plugin [id: 'com.android.application', version: '7.1.2', apply: fals

javascript canceled request after 50 seconds

Describing of context: java app (running under wildfly) works under high workload and heap is almost filled. Because of that full GC runs often and this leads t

How to get response in Map in httpClient?

I'm making a request to my server, but the response is given in String, and I need to get data from there, for example, the if response: {"response":{"balance":

How to verify aadhar XML signature with the help of public key certificate in Java?

I am working on Aadhaar Paperless Offline e-kyc, trying to validate aadhaar XML signature using public key certificate. But I'm not sure is this the right way t