fork download
  1. public static void main (String[] args) {
  2.  
  3. String text = "Changing banking for good. Ready to help us change the banking world?";
  4.  
  5. int mystery = text.split("\\s+").length;
  6.  
  7. System.out.println("Mystery = " + mystery);
  8.  
  9. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: error: class, interface, or enum expected
public static void main (String[] args) {
              ^
Main.java:5: error: class, interface, or enum expected
   int mystery = text.split("\\s+").length; 
   ^
Main.java:7: error: class, interface, or enum expected
   System.out.println("Mystery = " + mystery);
   ^
Main.java:9: error: class, interface, or enum expected
}
^
4 errors
stdout
Standard output is empty