fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. String test = "one (1), two (2), three (3)";
  13. List<String> tokens = test.getTokens("[^, ]+"); // Single blank is the separator.
  14. System.out.println(Arrays.toString(tokens));
  15. }
  16. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:13: error: cannot find symbol
		List<String> tokens = test.getTokens("[^, ]+");     // Single blank is the separator.
		                          ^
  symbol:   method getTokens(String)
  location: variable test of type String
Main.java:14: error: no suitable method found for toString(List<String>)
		System.out.println(Arrays.toString(tokens));
		                         ^
    method Arrays.toString(long[]) is not applicable
      (argument mismatch; List<String> cannot be converted to long[])
    method Arrays.toString(int[]) is not applicable
      (argument mismatch; List<String> cannot be converted to int[])
    method Arrays.toString(short[]) is not applicable
      (argument mismatch; List<String> cannot be converted to short[])
    method Arrays.toString(char[]) is not applicable
      (argument mismatch; List<String> cannot be converted to char[])
    method Arrays.toString(byte[]) is not applicable
      (argument mismatch; List<String> cannot be converted to byte[])
    method Arrays.toString(boolean[]) is not applicable
      (argument mismatch; List<String> cannot be converted to boolean[])
    method Arrays.toString(float[]) is not applicable
      (argument mismatch; List<String> cannot be converted to float[])
    method Arrays.toString(double[]) is not applicable
      (argument mismatch; List<String> cannot be converted to double[])
    method Arrays.toString(Object[]) is not applicable
      (argument mismatch; List<String> cannot be converted to Object[])
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
2 errors
stdout
Standard output is empty