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. // your code goes here
  13. String a = "{ \"id\": 1 }";
  14. byte[] b = a.getBytes();
  15. b = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 100, 101, 102, 103};
  16. String c = new String(b);
  17. byte[] d = c.getBytes();
  18. String e = new String(d);
  19. byte[] f = e.getBytes();
  20. String g = new String(f);
  21. byte[] h = g.getBytes();
  22. String i = new String(h);
  23. byte[] j = i.getBytes();
  24.  
  25. System.out.println(a);
  26. System.out.println(Arrays.toString(b));
  27. System.out.println(c);
  28. System.out.println(Arrays.toString(d));
  29. System.out.println(e);
  30. System.out.println(f);
  31. System.out.println(g);
  32. System.out.println(h);
  33. System.out.println(i);
  34. System.out.println(j);
  35. }
  36. }
Success #stdin #stdout 0.08s 380160KB
stdin
Standard input is empty
stdout
{ "id": 1 }
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 100, 101, 102, 103]
	defg
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 100, 101, 102, 103]
	defg
[B@1ddcac5
	defg
[B@2b7fc2
	defg
[B@1d0bc85