fork download
  1. class WordCount {
  2. public static void main(String[] args) {
  3.  
  4. String s = "hello world hello";
  5.  
  6. String[] words = s.split(" ");
  7.  
  8. for (String w : words) {
  9. System.out.println(w);
  10. }
  11. }
  12. }
Success #stdin #stdout 0.08s 16524KB
stdin
Standard input is empty
stdout
hello
world
hello