Examlex

Solved

Public Class CostArray

question 12

Essay

public class CostArray
{
    public static void main(String[] args)
    {
       double[] costs = new double[3];
       costs[0] = 5.00;
       costs[1] = 7.00;
       costs[2] = 9.00;
       System.out.println(costs[3]);
    }
}
Once the above code is compiled and executed, an error message is generated. Explain the error message that will result and explain the reason for the error.


Definitions:

Wildcard

A symbol used to represent one or more characters in a search or pattern matching operation.

AbstractSequentialList

A Java class that provides a skeletal implementation of the List interface to minimize the effort required to implement this interface backed by a sequential data store.

Random Access

The ability to access an arbitrary element of a sequence in constant time, typically associated with data stored in memory or on disk.

Related Questions