/* package whatever; // don't place package name! */ import java.util.*;import java.lang.*;import java.io.*; /* Name of the class has to be "Main" only if the class is public. */class Ideone{ public static void main (String[] args) throws java.lang.Exception { // your code goes hereString s = "My name is Jack"; String[] arr = s.split(""); char[] a = Arrays.toString(arr).toCharArray();System.out.println(a);System.out.println(new String(a)); }}
Standard input is empty
[M, y, , n, a, m, e, , i, s, , J, a, c, k] [M, y, , n, a, m, e, , i, s, , J, a, c, k]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!