I'm totally lost. I have a programming partner and this is what he sent me. I can't get the program to compile. I don't know where to start. Any suggested place to start?
package Assignment2;
public class TooBigException extends Exception
{
private static final long serialVersionUID = 1L;
public TooBigException(String mess)
{
super(mess);
}
}
package Assignment2;
import java.util.Random;
public class ListOfInts
{
protected int[] data;
public ListOfInts(int[] data)
{
if (data.length <= 0)
{
throw new IllegalArgumentException("this is an error called by error to small");
}
this.data = data;
} // constructor
public ListOfInts(int n, int max)
{
if (n<=0)
{
throw new IllegalArgumentException("this is an error called by error to small");
}
data = new int[n];
Random prng = new Random();
for (int index = 0; index < n; index++)
data[index] = prng.nextInt(max);
} // constructor
protected ListOfInts()
{
// placeholder for subclasses
// we'll discuss this in class
} // no-arg constructor
public void set(int index, int val)
{
data[index] = val;
} // set()
public int get(int index)
{
return data[index];
} // get()
// Test driver
public static void main(String[] args)
{
final int n = 1;
ListOfInts aList = new ListOfInts(n, 10);
for (int index = 0; index < n; index++)
System.out.println(aList.get(index));
System.out.println("Element 3: " + aList.get(3));
aList.set(3, -aList.get(3));
System.out.println("Element 3 negated: " + aList.get(3));
} // main()
} // class ListOfInts