I have the correct solution - submitted it through web, but IDE is giving this error:
Exception in thread "main" java.lang.NumberFormatException: For input string: "Jack"
at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67)
at java.base/java.lang.Integer.parseInt(Integer.java:668)
at java.base/java.lang.Integer.parseInt(Integer.java:786)
at com.codegym.task.task04.task0441.Solution.main(Solution.java:15)
Process finished with exit code 1
IDE
Under discussion
Comments (5)
- Popular
- New
- Old
You must be signed in to leave a comment
Jack
12 March 2022, 21:58
Here is code causing error - as I said, worked directly on web, not in IDE:
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package com.codegym.task.task04.task0443;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Solution {
public Solution() {
}
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String name = reader.readLine();
String year = reader.readLine();
String month = reader.readLine();
String day = reader.readLine();
System.out.println("My name is " + name + ".");
System.out.println("I was born on " + month + "/" + day + "/" + year);
}
}
0
Guadalupe Gagnon
14 March 2022, 15:24
You probably have the wrong task set in the configurations:
Initial post:
"at com.codegym.task.task04.task0441.Solution.main(Solution.java:15)"
The code that you shared says:
"package com.codegym.task.task04.task0443;"
The task you are getting an error on is 0441, however the code you shared is 0443. That means that the configurations in IntelliJ are set to run 0441. When you hit the green arrow at the top it does not run the code that is currently on your screen but instead runs the code that is set in the configurations. This is a feature of intelliJ that helps developers because typically projects have many different classes and files all interconnected with multiple entry points. When you want to run a certain code and need to make changes in other code its nice that you don't need to flip back after making a change to run and test, though it can be a pain for codegym tasks that are one HUGE project of individual tasks.
To change the configurations just simply right click in the code that you want to run and select "run" from the menu. This will set the configurations to the code that is on the screen. You can also click the green arrow to the left of the main method. Every time you start a new task do that at least once to make sure the configurations are set properly, or just get used to always using the green arrow next to the main method. See Picture:
![]()

0
Jack
11 March 2022, 22:32
Yes, am I allowed to post answer here?
0
Guadalupe Gagnon
12 March 2022, 02:12
It used to be that it really wasn't allowed, but everyone did it. Now you can download a correct answer directly from codegym on any task, making posting your solve not a big deal
0
Guadalupe Gagnon
11 March 2022, 22:04
It says that on line 15 of your code that your input of "Jack" is being tried by the program to parse to a number. Are you inputting the data in the correct order?
0