product.toCharArray()
The toCharArray is not a static method, but is a method of a string that already exists, which is why it didn't compile for you.
Here is a longer example:
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);
}
}
w. can i ask why you want to get an integer to a char array?