0
Why is the code not taking input
https://sololearn.com/compiler-playground/cUupVyeCC446/?ref=app
3 Answers
+ 3
Ausgrindtube
I uncomment both lines and entered <64 3.14>, it returns true and print the variable as 64.
I think it checks the Scanner object has a valid float or not, not the variable a.
+ 3
zeeshan Learn Java course then you will understand why you are not getting input?
1) Uncomment
2) It only accepts integer value
3) If I enter value in float it shows java.util.InputmismatchException
Because of incorrect or mismatch data type
If you know the basics of java you will understand these things.
+ 1
Will it accept a float if the variable is declared as an integer?