/* B1:
Program to catch Negative Array Size Exception. This exception is caused when the
array is initialized to negative values.*/
class programb1
{
public static void main(String as[])
{
int arrSize = -8;
try {
int[] myArray = new int[arrSize];
} catch (NegativeArraySizeException ex) {
System.out.println("Can't create array of negative size");
}
}
}