Examlex
public class exceptions
{
public static void main(String Args[])
{
int[] array = new int[3];
try
{
for(int a=0;a
{
array[a] = a;
}
System.out.println(array);
}
catch(ArrayIndexOutOfBoundsException e)
{
System.out.println("Out of bounds");
}
}
}
In the above code, the line System.out.println(array); gets skipped when an exception occurs. Write a finally block that will execute, and will execute a System.out.println(array); if there is an exception.
Q2: Write the statement to create an array
Q11: Psychological egoism is a theory that holds
Q15: Describe the difference between an ActionEvent and
Q16: Layout managers are interface classes that align
Q20: When array elements are passed by value,
Q22: The cost benefit analysis is used by
Q35: When you perform input and output operations
Q37: The memory location known as the _
Q51: BasicStroke class variables determine the endcap and
Q61: How many times will outputLabel be called?