64 686
Assignments Done
99,3%
Successfully Done
In September 2018

Answer to Question #63999 in Java | JSP | JSF for hamod

Question #63999
what is the output of the following code segment? show your work
public int DoIt(){
int []a=new int[10];
int temp=a[2];
try{
String a=null;
String b=a.toUpperCase();
System.out.println("\n departing DoIt()");
System.out.println("\n in try zone");
}
catch (ArithmeticException e)
{
System.out.println("\n caugh arithmetic exception inside DoIt()");
}
catch (Exception w)
{
System.out.println("\n caugh exception inside doit()");
throw new IndexOutOfBoundsException("temp=a[12]");
}
finally{
System.out.println("\n finally inside doit()");
}
System.out.println("\n after try ::doit()");
return temp;
}
void one()
{
try
{
int x=DoIt();
System.out.println("\n after calling DoIt()");
}
catch (ArithmeticException e)
{
System.out.println("\n caugh arithmetic exception ");
}
catch (Exception w)
{
System.out.println("\n caugh exception ");
}
finally{
System.out.println("\n done doing it");
}
System.out.println("\n outta here...bye");
}
Expert's answer

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions