+ 3
Please someone find error in this code. Exception in thread "main" java.lang.NullPointerException
14 Respuestas
+ 2
the code is probably missing some imports... double check.. I'm sleepy.😴
+ 2
sleepy last night.. I didn't see the * on io imports.. Try to specify the exact location or directory of your files.. on PC something like FileReader("c://JavaProjects//filename.txt"); on smartphones, I don't know how to locate the directory, and probably you'll need permissions in accessing the drives..😸.. keep calm and enjoy coding..🏃🏃
+ 1
Aisha aa u can observe something is wrong with way u parse argument go to stack overflow u can get this fixed easily
+ 1
Your in.ReadLine() is causing the problem.
You can test it by using a Scanner or replace it with an "4"
+ 1
Paste the error code you get on Eclipse here
0
what to write instead of in.readLine() ?
0
What are you trying to achieve with DataInputStream?
0
it allows an application to read primitive data from the input stream in a machine-independent way
0
You mean like a file stream?
0
:/ I prefer using the Scanner class. Just because it will save time for now
0
program is running fine, I'm getting error when I'm selecting choice 2 i.e. voting.
error is in voting func.
0
Well File not found?
Does it work on PC?
0
Yeah. it is working Only I'm getting error while selecting choice 3 i.e. voting
0
This would be so perfect in C# tho.
Option 1: Ok
Option 2: File not Found
Option 3: File not Found
Option 4: Ok