Write a program String To Characters Array using java- Technology369kk

 Program:

public class StringToCharArr {
public static void main(String[] args) {
String strOrg ="Hello World!!";
char[] stringArray;

// covert string into array using toCharArray() method of string class.
stringArray = strOrg.toCharArray();

for(int index =0; index <stringArray.length; index++){
System.out.print(stringArray[index]);
}

}

}

 

Answer: 


Hello World!! 
 


Post a Comment

0 Comments