Hello all, I am having a tough time with objects. I have looked at this code for over 24hrs, and seen my instuctor, but I am truely lost. This stuff makes only some sense. I am not understanding what I am doing wrong. I get the error below.
Instantiating two MyString objects.
Objects instantiated.
Testing getString() returns the
string: passed
Testing nextChar() advances to the next character of the string: failed
Testing noMore() returns false if there is more string to go: failed
Testing nextChar() returns 0 and does not advance if out of string: failed
Testing noMore() returns true if there is no more string to go: failed
Testing resetIndex() resets the objects index to 0: failed
Instantiating MyString( null )
Exception in
thread "main" java.lang.NullPointerException
at MyString.noMore(MyString.java:60)
at TestMyString.main(TestMyString.java:74)
Press any key to continue . . .
My sample code thus far is;