Java challenge answer | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 2

Java challenge answer

Why is the answer to the output question: "Run Time Exception"? But when I run the code it gives me no errors, but result of 2, which I expected! https://code.sololearn.com/c6g64lkpRTLx/?ref=app

3rd Nov 2019, 10:59 AM
Radu Harangus
Radu Harangus - avatar
2 Respuestas
+ 2
@Nitin Tiwari I don't understand your explanation! What does the network's speed have to do with the right / wrong answer, since I got the answer? maybe I wasn't clear enough: In a java challenge, one question was "What is the output of this code?" with 3 options: "RunTimeException", "2", "2.5". I chose the answer "2" which turned out to be false and when the correct answer shows as to be "RunTimeException". I didn't understand why, so this is actually my question. But anyway I went ahead to check in the code playground and, to my surprise, when I run the code I get the answer "2". In conclusion, which is it right and why?
3rd Nov 2019, 2:39 PM
Radu Harangus
Radu Harangus - avatar
+ 2
So the answer of that questions was wrong. Sorry for the first answer did not understand your question well
3rd Nov 2019, 3:43 PM
Nitin Tiwari
Nitin Tiwari - avatar