Method citiesNames() returns List<“String”>. The names of cities. Method “int getDistance(String srcCityName, String destCityName)” returns distance between srcCityName and srcCityName. PS: It is forbidden to use loops, iterators inside this class. Only streams and methods that a…
Tag: java
Caused by: java.lang.IllegalAccessError: superclass access check class apache (in module x) that cannot access another apache class (in mod y)
I’m new to modularized java 16 projects as well as using the maven build system whilst trying to implement the program using IntelliJ, JAVAFX and APACHE POI-OOXML. For simplicity, I am implementing a button’s event handler that instantiates a class that is responsible for using Apache: ControllerC…
Eclipse not able to see javax package
I’m currently trying to fiddle with images, specifically convert images from JPEG, WEBP, and BMP forms to PNG forms and my method uses the javax.imageio.ImageIO class. When I tried importing it, Eclipse yelled that the package that the type was not accessible. I thought that was weird and went digging t…
How to get latitude and longitude separately in 2 textviews in android studio JAVA?
from this i’m getting latitude and longitude in a single textview. But I want the latitude to be in 1 textview and longitude in another text view. Please help me on this. My main activity my geocodinglocation class.java from this i’m getting latitude and longitude in a single textview. But I want …
Remove delay while pressing the second key LWJGL Java
I am running into a problem that I cannot find any solution for the moment even by searching on the internet. I am currently working on a 2D game and I want my player to go on every direction and diagonally. For that reason I need to get two inputs from the keyboard, thing that I could code but now
Cannot open index page in Thymeleaf, getting 404 in Intellij IDEA
I’ve created simple demo for Spring boot and Thymeleaf, but I cannot open index page. Controller code: Having index template in /src/main/resources/templates/index.html Having application.properties: server.port=9095 And going to the address http://localhost:9095/ And getting error: Spring boot class is…
Android date is incorrect
I am using Calendar class to get year, month and day: Today is 11 Dec 2021 (2021-12-11). But toast alert shows 2021-11-11. Also I tried to set calendar time to a new Date class but still wrong Answer tl;dr I am using Calendar class Don’t. Use only java.time classes. 2021 Details The Answer by Modi is correct.…
How to create JOptionPane with multiple list selections and extract all the choices?
I am interested in creating a JOptionPane or any interactable pop-up Pane that contains multiple list selections. I also wish to extract the selections the user made. The code below shows an MRE where I generate two different JOptionPanes with list selections and extract the choice from each. Essentially, I a…
How to consume infinite flux multiple times
This is what I’m trying to achieve: When somebody requests http://localhost/runIt, I would like to return data from cache that would be refreshed every 6 seconds. Below, I have a flux (always same one that is stored in map) that is first time instantiated and starts emitting numbers 0,1,2,3,4… to …
Log4j vulnerability – Is Log4j 1.2.17 vulnerable (was unable to find any JNDI code in source)?
With regard to the Log4j JNDI remote code execution vulnerability that has been identified CVE-2021-44228 – (also see references) – I wondered if Log4j-v1.2 is also impacted, but the closest I got from source code review is the JMS-Appender. The question is, while the posts on the Internet indicat…