Monday, September 29, 2008

JAVA STRINGS TO CHAR ARRAY

Java String to CharArray Example .
String class toCharArray method example:- This example demonstrates the working of toCharArray method. this method converts complete String value in to a char array type value.
Syntax:- toCharArray()
Here is the code:-
/** * public class ToCharArrayString
{
public static void main(String args[])
{
//method converts complete String value to char array type value
String str = " einstein relativity concept is still a concept of great discussion";
char heram[] = str.toCharArray
// complete String str value is been converted in to char array data by the method //
System.out.print("Converted value from String to char array is: ");
System.out.println(heram);
}
}
output:Converted value from String to char array is:
einstein relativity concept is still a concept of great discussion **/

No comments: