Gus Moeller

Greenhorn
+ Follow
since Feb 25, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Gus Moeller

Yeah, thanks, I ended up getting it worked out, but those were exactly my problems.


This is what I ended up with, I know there's a lot of redundant loops in there, but it's due today. Hopefully I'll get time to clean it up later.

Thanks again.
15 years ago
It was intended to be a variable for the array, initially line 37 used an i for the count variable, that's where I got the error. This code is the result of me trying to tweak it to get it to work. When I switched the count variable to a in line 37 I got an error in the array variable on line 40.
15 years ago
Can someone please help me understand why I'm getting an exception here?
_____________________________________________________________________________

run:
Welcome to inventory managment.

How many items?
3
Enter item name: Homo
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at inventory.Inventory.main(Inventory.java:39)
Java Result: 1
BUILD SUCCESSFUL (total time: 16 seconds)
_____________________________________________________________________________



Thanks in advance.
15 years ago