fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.util.list;
  5. import java.lang.*;
  6. import java.io.*;
  7.  
  8. /* Name of the class has to be "Main" only if the class is public. */
  9. class Ideone
  10. {
  11. public static void main (String[] args) throws java.lang.Exception
  12. {
  13. String test = "one (1), two (2), three (3)";
  14. List<String> tokens = test.getTokens("[^, ]+"); // Single blank is the separator.
  15. System.out.println(Arrays.toString(tokens));
  16. }
  17. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:4: error: cannot find symbol
import java.util.list;
                ^
  symbol:   class list
  location: package java.util
Main.java:14: 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:15: 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
3 errors
stdout
Standard output is empty