How to use Exception handling? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How to use Exception handling?

My code sometimes throw a number format exception. Where should i put try-catch statement? In that specific line that throws error or for the entire code? Problematic line of code; String[]x=screen.getText().toString().split("\\+");

16th Nov 2020, 5:29 AM
Mons Joseph
Mons Joseph - avatar
2 Answers
+ 4
Hello, Exception topic is already given by SoloLearn in their lessons. Please go through this. https://www.sololearn.com/learn/Java/2175/?ref=app https://www.sololearn.com/learn/Java/2176/?ref=app https://www.sololearn.com/learn/Java/2177/?ref=app https://www.sololearn.com/Course/Java/?ref=app If you're still having problem.. then kindly attach your code, so community members can help you accordingly. Happy Coding!
16th Nov 2020, 7:11 AM
Minho
Minho - avatar
0
Its very simple , compiler give full details about exception and which line throws that exception.
16th Nov 2020, 5:38 AM
Prathvi
Prathvi - avatar