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[] ray = {"abc","ade","123","wer","234","678","fun"};
  13. System.out.println(ray[0]);
  14. //System.out.println(ray[0].charAt[0]);
  15. System.out.println(ray[6]);
  16. System.out.println(ray[1]);
  17. System.out.println(ray.length);
  18. ray = "one two three four five six seven eight".split(" ");
  19. System.out.println(ray[0]);
  20. System.out.println(ray[3/2].charAt(0));
  21. System.out.println(ray[7/2]);
  22. System.out.println(ray[1]);
  23. System.out.println(ray.length);
  24. ray = "abc-789-456-976".split("\\-");
  25. System.out.println(ray[0]);
  26. System.out.println(ray[3*1]);
  27. System.out.println(ray[2].replaceAll("[46]","#"));
  28. System.out.println(ray[1]);
  29. }
  30. }
Success #stdin #stdout 0.1s 55640KB
stdin
Standard input is empty
stdout
abc
fun
ade
7
one
t
four
two
8
abc
976
#5#
789