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");
}
1
Expert's answer
2016-12-16T06:00:09-0500
The answer to the question is available in the PDF file https://www.assignmentexpert.com/https://www.assignmentexpert.com/homework-answers/programming-answer-63999.pdf

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 the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS