+ 1

Can you find error

can you find error from this program .. https://code.sololearn.com/cD3p0uIPFmMq/?ref=app

6th Dec 2017, 12:27 AM
Sreejith P
Sreejith P - avatar
4 Answers
+ 7
Change: int a; to: int a = 0; and: a=Integer.parseInt(in.readLine()); to: try{ a=Integer.parseInt(in.readLine()); } catch(IOException e){ // Error with readLine() } catch(NumberFormatException e){ // Wrong type of input } PS: DataInputStream might not work on codeplayground.
6th Dec 2017, 1:03 AM
Rrestoring faith
Rrestoring faith - avatar
+ 5
DataInputStream doesn't work on code playground. Try something else like BufferedReader or Scanner.
6th Dec 2017, 2:38 AM
qwerty
qwerty - avatar
+ 2
Can you help me to correct on playground.. pls
6th Dec 2017, 1:29 AM
Sreejith P
Sreejith P - avatar
+ 1
I got same error in eclipse đŸ€”..
6th Dec 2017, 3:04 AM
Sreejith P
Sreejith P - avatar