That's not true: all these classes and methods are already implemented; all you
have to do is use (invoke or call) them to make use of them. Are you the poster
who wanted to implement the 'Nim' game without wanting to use arrays and
methods?
kind regards,
Jos
Hah, yes that's me.
I've passed in the last assignment, and I had no troubles.
I'm not allowed to implement arrays/string tokens, etc.. (theoretically) because my uncle has yet to teach us, so I can't jump ahead.
I have an idea of how to count the words.. my current code is as follows:
[PHP]import java.io.*;
public class WordCount
{
public static void main(String SomeStrings.s1, BufferedReader in)
{
String line;
long numWords = 0;
int index = 0;
boolean prevWhiteSpace = true;
while(index < line.length()){
char c = line.charAt(index++);
boolean currWhiteSpace = Character.isWhitespace(c);
if(prevWhiteSpace && !currWhiteSpace){
numWords++;
}
prevWhiteSpace = currWhiteSpace;
}
System.out.println(numWords);
}
}[/PHP]
As you can see I state in the method (String SomeStrings.s1)
SomeStrings.s1 is part of SomeStrings.class which I've placed in my Java Files folder.
Yet when I compile this I get a nasty red error:
Current document is out of sync with the Interactions Pane and should be recompiled!
Thanks a lot.