Question: Question 2 9 3 pts Analyze the following program. class Test public static void main ( String [ ] args ) { try { String
Question pts Analyze the following program. class Test public static void mainString args try String s ; Integer.parseInts; Causes a NumberFormatException int i ; int y ; Causes an ArithmeticException System.out.printlnWelcome to Java"; catch Exception ex System.out.printlnex; An exception is raised due to Integer.parseInts; An exception is raised due to i; The program has a compilation error. The program compiles and displays "Welcome to Java". The program compiles and displays "For input string: then "Divide by zero" then "Welcome to Java" Question pts Suppose s is a string with the value "java". What will be assigned to x if you execute the following code? char x scharAt; a v Nothing will be assigned to x because the execution causes the runtime error StringIndexOutOfBoundsException. None of the above. Question pts How many times is the following loop body repeated? What is the output of the loop? int i ; while i ifi System.out.printi ; i; B IV A A Ix Ex X SE TT pt Paragraph O words Question pts Convert the following for loop into a dowhile loop. int sum ; for int i ; i ; i sum i; B I VA A Ix Ex X SE BRV pt Paragraph
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
