Question: java Analyze the following code: class Test I public static void main(Stringll args) f try 1 String s=5.6; Integer.parselnt(s): // Cause a NumberFormatException int i=0;

Analyze the following code: class Test I public static void main(Stringll args) f try 1 String s=5.6; Integer.parselnt(s): // Cause a NumberFormatException int i=0; int y=2/i; 1 catch (Exception ex) ! System,out.println("NumberFormatException"): 1 catch (RuntimeException ex) System.out.printin("RuntimeException"); I I I A) The program displays Runtimelixception. B) The program displays NumberFormatException. C) The program displays Numberformatf veeption followed by Runtime Exception. D) The program has a compilation error. Show the output of running the class Test in the following code lines: interface A\{ \} class C \{ \} class B extends D implements A \} public class Test \{ public static void main(String[] args) \{ Bb= new B( ); if ( b irhtanceof A ) System out println(" b is an instance of A "), if ( b instanceof C ) System.out.printin(" b is an instance of C "); \} \} class D extends C
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
