+ 2
What is wrong with this code?Why is it not accepting input from keyboard?
11 Réponses
+ 18
Seems like Sololearn does not support an input using DataInputStream. Try to run this code on your local machine.
+ 14
You need to use the Scanner class for this purpose.
+ 7
Mystery
https://www.tutorialspoint.com/compile_java_online.php
It's working on tutorialpoint java compiler
Just write your input in Stdin and execute
MY OUTPUT
javac Program.java
Note: Program.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
$java -Xmx128M -Xms16M Program
enter no. m=76556
I think Igor Makarsky was right that its doesn't have support on Sololearn
+ 6
Mystery
I remove your try catch blocks
I got some unreported IO Exception at DataInputStream method
+ 3
Rstar thanks for the links but it would be better if you told me what is wrong with my code
+ 3
Ok Igor Makarsky Jamie💐 thanks guys
+ 3
Rstar yeah i got that too therefore i used try and catch
+ 2
Igor Makarsky but what if i want to use DataInputStream?
+ 2
Igor Makarsky i know using Scanner is easier way but I have DataInputStream in my syllabus so i need to do it using this only
+ 1
Jamie💐 no. I think I need to try that. Thanks. But still the question remains that is what is wrong with it that it won't work in codeplayground?