Hey Yall, just wondering if anybody could shed some light on my code here. I am supposed to create a program that counts the words that I enter in my main method and then print them in original form and lowercase form. I have instantiated 4 objects (strings) in my main method. Thoes strings get passed into my WordCounter class. My WordCounter class is an extension of the Counter class. My Counter class was given to me and is not to be altered. I am having a problem with nulls. When I run the main method all I get are nulls. I understand why I am getting them, but I'm not really sure how to get around them. I have tested the string array in the constructor by placing a SOP in there and the output matches the strings in my main method. So at least I know the array is filling up. The nulls are coming from the getLowerCase and getOriginal methods. I thought I had the problem solved when I added the "this" command to them, but no change. Anyway, here is the code: Thanks in advance
[ January 16, 2004: Message edited by: Steve Wysocki ]
posted 15 years ago
Never mind, figured it out...Bonehead mistake. this.myStrings[i] instead of this.aWord aWord is null when that method is called.
That is a really big piece of pie for such a tiny ad:
how do I do my own kindle-like thing - without amazon