Hi there. I was wondering if anyone could help me out here... We are currently doing a project that involves creating a new class called sublist. This takes params of (MyList list, int startIndex, int endIndex). It is basically a partial view of the list (MyList is used because we have been making our own). I'm not looking for an answer, just help here. We are not to change that constructor, and if you edit anything about the sublist, it should change the actual list. (IOW if you look from the 3rd object to the 5th, and add a new one, it should be so in the original, non-sub list as well) Any help would be appreciated.
(Sorry for the delay.. networking troubles) Well, I have thought about basically extending our class, MyAbstractList, then for the constructor, make a new MyList by iterating through the startIndex and endIndex and add it to the new MyList. Of course, now I am having all null pointer exceptions (We have 10 test cases... all fail at the same point in the constructor) Here is what I have. Any help would be great Thx again. BTW... we can't change the constructor params. The MySubList (what we are writing)
The MyAbstractList (that I extended)
And the MyList...
If you need to see any other files, let me know. We made a lot over the time, but those are the ones I can see as important. Can't get over the nulls...
Hmm.. I wrote like 170 or so lines of code now, and that one part is STILL causing me errors... I tried adding a while hasNext part, to make sure there is a next before going on, but the test cases all still reveal a NULL POINTER EXCEPTION ERROR! ... here is where I am having the trouble
That is what I thought... but everytime I tried to do that, it says I can't. MyList is an interface, and it won't allow me to initialize it so. Hmmmm =( I figure looking at the code they have would help greatly... just can't seem to find it for some reason. Thx everyone!