Question: Question 2 9 3 pts Analyze the following program. class Test public static void main ( String [ ] args ) { try { String

Question 293 pts Analyze the following program. class Test public static void main(String[] args){ try { String s ="5.6"; Integer.parseInt(s); // Causes a NumberFormatException int i =0; int y =2/1; // Causes an ArithmeticException System.out.println("Welcome to Java"); } catch (Exception ex){ System.out.println(ex); }} An exception is raised due to Integer.parseInt(s); An exception is raised due to 2/i; The program has a compilation error. The program compiles and displays "Welcome to Java". The program compiles and displays "For input string: '5.6" then "Divide by zero" then "Welcome to Java" Question 303 pts Suppose s is a string with the value "java". What will be assigned to x if you execute the following code? char x = s.charAt(4); 'a 'v' Nothing will be assigned to x, because the execution causes the runtime error StringIndexOutOfBoundsException. None of the above. Question 315 pts How many times is the following loop body repeated? What is the output of the loop? int i =0; while (i <20){ if((i +1)%2==0) System.out.print(i +""); i++; } B IV A - A - Ix Ex? X, SE TT 12pt Paragraph O words Question 325 pts Convert the following for loop into a do-while loop. int sum =0; for (int i =0; i <100; i++){ sum += i; } B I VA - A - Ix Ex X, SE BRV 12pt Paragraph

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Finance Questions!