error creating 2d array of type object

Java
So, I'm trying to make a board that holds objects called Nodes but for some reason, when I try to create the array of Nodes, I get the error in the ti...
2 years ago

Calculate 16 bit CRC in java and append it at the end of the byte array

Java
I have the following buffer byte pingBuff[] ={0x01, 0x01,0x00,0x01,0x00,0x20} I need to calculate 16 bit CRC of these 6 bytes and append it at the ...
2 years ago

Initialization of an ArrayList in one line

Java
I want to create a list of options for testing purposes. At first, I did this: ArrayList<String> places = new ArrayList<String>(); places...
2 years ago

FizzBuzz without AND operator

Java
For those who don't know, FizzBuzz is the following problem: Write a program that prints the numbers from 1 to 100. But for multiples of three ...
2 years ago

Purpose of casting like this?

Java
Is there any purpose to casting like this? Sorry guys it seems my code stripping caused some confusing. Full method goes like this: public String f...
2 years ago

LibGDX render only, if camera sees it

Java
So, I have created my first game. on computer it works(60FPS) but on my mobile, I have 50FPS, and sometimes it jumps to 30 and back again, you see it ...
2 years ago

RecyclerView in Fragment

Java
I am setting up a RecyclerView inside a Fragment following the Android docs example here. I pasted my code below, there is not much. (The only diffe...
2 years ago

Need to print with 2 decimal spaces instead of 1 (particular instance) in java

Java
I currently have a code that works properly (compiled and tested multiple times) however I am outputting: Card Balance: $500.0 Minimum payment to pri...
2 years ago

Gson and abstract superclasses: deserialization issue

Java
Suppose to have an abstract class, say A, and two non-abstract subclasses, say A1 and A2. I want to "deserialize" them from a json format by using the...
2 years ago

how to receive json response from spring controller to a jsp page

Java
I have created one JSP page, with some some text fields. On click of submit button, it calls Ajax call to post the data to Spring controller. Now afte...
2 years ago

How to get Base64 String from InputStream?

Java
I'm on a problem by taking the selected gallery picture and want to save it first as Base64 String in a XML file (for later use. For example if you ex...
2 years ago

Converting java.time to Calendar

Java
What is the simplest way of getting a Calendar object from a java.time.Instant or java.time.ZonedDateTime? ...
2 years ago

error while generating android signed app

Java
i am getting this error while generating android signed app Error:Execution failed for task ':app:dexRelease'. > com.android.ide.common.process.P...
2 years ago

Log4j 2 doesn't support log4j.properties file anymore?

Java
I am running an example using log4j 2.0-rc1 and log4j.properties file, but log4j lib always runs it with the default configuration (log level, appende...
2 years ago

Static initializer not called on Activity creation

Java
I have the following code in my main Activity: protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ...
2 years ago

Email Me Every Time Catalina.out Receives an Exception

Java
Struggling with finding a solution to the pain of having to constantly access my server, load the catalina.out file, and wade through the mess to find...
2 years ago

How do I set the proxy to be used by the JVM

Java
Many times, a Java app needs to connect to the Internet. The most common example happens when it is reading an XML file and needs to download its sche...
2 years ago

Gradle + Dropwizard + Shadow -> Could not find or load main class

Java
I'm trying to create a simple microservice using Dropwizard and Gradle as a build system. No database, only REST endpoint to expose. So I have a con...
2 years ago

UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException: Multiple dex files define

Java
When I add the configurations for google analytics to my Android project and build the project I get the following error: :app:transformClassesWithDe...
2 years ago

JDBC - Generic way of dealing with different objects in single transaction?

Java
So I have Object A and B that I want to commit to the database in a single transaction. It seems easy as it is just a matter of setAutoCommit(false). ...
2 years ago