I'm getting and error when I try to run this program
Here's what I get: Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 4 at java146.project1.ProcessOrders.writeOutput(ProcessOrders.java:135) at java146.project1.ProcessOrders.run(ProcessOrders.java:29) at java146.project1.OrderDriver.main(OrderDriver.java:22)
I don't understand why this is happening. [ February 08, 2005: Message edited by: Cary Tanner ]
Joined: Dec 29, 2004
Your orders Array is only of size 4. Why the magic number 5 in the writeOutput for loop? It should be i < orders.length.
Joined: Feb 08, 2005
Silly me, that's what I did at first but I guess I wrote "i <= orders.length", and the equals is what screwed me up. Thanks!