A tip for those of you having trouble with the last task:
If you divide an int by 10 you remove the last digit. So 89756 / 10 becomes 8975. Think about how you could use that in a loop.
The key of the "Even and odd digits" task is this: In decimal base, (1) the units digit is even if the number is even and (2) the units digit is odd if the number is odd.
Hi everybody, my solution worked but I have this issue on intellij IDEA...
"Exception in thread "main" java.lang.NumberFormatException: For input string: ""
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:592)
at java.lang.Integer.parseInt(Integer.java:615)
at com.codegym.task.task05.task0532.Solution.main(Solution.java:19)"
I don't know how to solved it... but the program don't run
ElektraLevel 2, United States of America, United States
9 January 2022
It seems like you have a problem with your input.
Double-check you input handling code.
Justin SmithLevel 41, Greenfield, USA, United States
7 July 2021
Even and Odd digits is by far the hardest task so far. I've been staring at it for a full 20 minutes and haven't typed anything because I don't have a clue where to even begin. Been cruising through most of these tasks since Level 0 and I feel like I just hit a wall, haha.
Justin SmithLevel 41, Greenfield, USA, United States
6 July 2021
I think "Cat & Dog Objects: 50,000 Objects" needs an update. Intellij IDEA displays the finalize method with a strikeout and says it is "deprecated". My validation passed, but when running the program it doesn't print any lines (my guess is that it's ignoring the finalize() method entirely due to it being deprecated).
Even and odd digits 에서 제일 중요한건 입력받은 숫자를 '나눠서 처리하기에' 적절한 메소드를 활용하는 것입니다.
저는 substring을 활용하였습니다만, for(int i=0; i<length; i++){num[length - i - 1] = number%10}와 같은 형태로 숫자를 나누는것도 고려해봄직 할 것 같습니다.
Cat and Dog objects: 50,000 each
I got this to work in CodeGym but when I ran it in IntelliJ (with Java JDK 12.0.2) I get the following message:
finalize()' is deprecated
GO TO FULL VERSION