Skip to content

Tag: java

I implemented Serializable but it still give me exception

this is my code: i dont know where is the error I search every where but I didn’t get the answer so any one of you guys have the answer for my question? because I’m new to files, and i want to complete this project Answer Everything field inside a Serializable has to either be null, or be refer to

How to repeat an array together with a counter

What I’m trying to do with the following code is to print numbers and to replace the number with a word for the number that are divisible for 3, for 5 and for both 3 and 5. So, when the user starts the code, it has to choose how many players are going to play. The problem is that my

How to properly null check/lazy load

I have a resource file that I load, when needed, to check if a certain word is among the ones in the file. I want to get rid of the method-wide synchronized keyword. There’s no point in all threads waiting while wordsInFile.contains(word.toLowerCase()); runs. Original: Is this OK? Answer This is a varia…

Find date inside each month

In my project, in the repository, this select finds the nearest date with a currency id that is less than or equal to the date whose range I set. How can I find a date in each month that is greater than or equal to the date I want to bind, but with the condition that this date must be

Checking a number for parity

To check that both expressions are true, you need to use &&. Syntax expression1 && expression2 In this problem, you need to check that the number passed is positive AND even my code: test: error: java.lang.AssertionError: expected [true] but found [false] at org.testng.Assert.fail(Assert.java:…