Stuck in while loop with BufferedReader-java -
i'm @ lose why isn't working. i've had similar loops before , they've worked fine.
try{ text = new bufferedreader(new filereader(filename)); while ((lineoftext = text.readline()) != null){ stringtokenizer tokens = new stringtokenizer(lineoftext," , .;:\"&!?-_\n\t12345678910[]{}()@#$%^*/+-"); while (tokens.hasmoretokens()){ counttotalwordsindocument++; string word = tokens.nexttoken(); counttotalcharactersinallwords = counttotalcharactersinallwords + word.length(); } } text.close(); } catch (ioexception e) { system.out.println("file not found"); }
Comments
Post a Comment