Examlex

Solved

Public Class Exceptions

question 59

Short Answer

public class exceptions
{
    public static void main(String Args[])
    {
       int[] array = new int[3];
       try
       {
          for(int a=0;a<4;++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.


Definitions:

Disgust

A strong feeling of aversion or revulsion often provoked by something perceived as unpleasant or offensive.

Normative Ethics

A branch of ethics concerned with establishing how things should or ought to be, focusing on the establishment of moral standards that guide actions.

Ethical Relativism

The perspective that moral standards vary across cultures and individuals, and that there are no universal ethical truths.

Socially Defined Behaviour

Actions or behaviors that are shaped, influenced, or regulated by the societal norms and values of a community.

Related Questions