Question: urgent. do in netbean JAVA (d) Given program code Q2(d) as shown in Figure Q2(d), answer the following question. () Explain why an error will
urgent. do in netbean JAVA
(d) Given program code Q2(d) as shown in Figure Q2(d), answer the following question. () Explain why an error will occur when this program code is compiled. [2 marks] (i) Rewrite the program so that the program will compile and run properly. [3 marks) - 19- SULIT (BEEC 1353) SULIT //Program 02 (d) public class Test public static void main(String[] args) { try ! String S-5.6"; Integer.parseInt(s); int i = 0; int y - 2 / i; catch (Exception ex) System.out.println("Number FormatException"); 1 catch (Runtime Exception ex) System.out.println("RuntimeException"); 1 Figure Q2(d): Program code
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
