- Joined
- Jun 20, 2001
- Location
- Vancouver, WA
I had to turn this in already, but I'd still like to know if anybody can tell me what's wrong with my code. Everything is good except for the second constructor for MultiSetB from what I can tell. When that constructor is run, I get a NullPointerReference expection (theElements is null for all values of i), and can't figure out why.
Just as an intro to the program, I'm supposed to be writing a class which implements the MultiSetI interface using an array of ElementNodes (an ElementNode contains an Object el and an int count). The MultiSet stores objects and the count of the number of objects within it's private array theElements. You can find more info (the entire assignment description ) here if you need it.
Code is attached (since it's kinda long and in 3 source files...). Thanks guys
JigPu
Code:
Exception in thread "main" java.lang.NullPointerException
at MultiSetB.<init>(MultiSetB.java:71)
at TestMultiSet.main(TestMultiSet.java:95)
Just as an intro to the program, I'm supposed to be writing a class which implements the MultiSetI interface using an array of ElementNodes (an ElementNode contains an Object el and an int count). The MultiSet stores objects and the count of the number of objects within it's private array theElements. You can find more info (the entire assignment description ) here if you need it.
Code is attached (since it's kinda long and in 3 source files...). Thanks guys
JigPu