Q10: Exceptions
-
Take out a piece of paper and put your name on the upper right corner.
-
Answer the following questions:
- Write a code segment that will compute the integer sum of String s1 and s2, or will print an error message if s1 or s2 cannot successfully be converted into integers. (Use a try..catch statement.)
Hint: You can use Integer.parseInt(String s).
Finish your answers before the timer runs out.