Guest User

Untitled

a guest
Sep 3rd, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. public static int countTokens(String sentence) {
  2. // Change or modify the return. This is here for now to prevent compiler
  3. // errors.
  4. int count = 0;
  5. Scanner s = new Scanner(sentence);
  6. while (s.hasNext())
  7. {
  8. s.next = count + 1;
  9. }
  10. return count;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment