Saturday, December 17, 2011

String To charArray Java


package stringReduction;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/*
 * author manish
 * This program will take a String and Convert to char array
 * remove/replace the package name for it to work
 * */
public class Solution {
public static void main(String[] args) {
System.out.print("Hello");
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
try {
String inputString=br.readLine();
//System.out.print(inputString);
char[] cArray = inputString.toCharArray();
     
       for (char c : cArray)
           System.out.println(c);

} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}

}