YouTip LogoYouTip

Java String Tochararray

# Java toCharArray() Method [![Image 3: Java String Class](#)Java String Class](#) * * * The toCharArray() method converts a string to a character array. ### Syntax public char[] toCharArray() ### Parameters * None ### Return Value A character array. ### Example public class Test { public static void main(String args[]) { String Str = new String("www."); System.out.print("Return Value :" ); System.out.println( Str.toCharArray() );}} The output of the above program is: Return Value :www. * * Java String Class](#) AI is thinking... [](#)(#) (#)[](#) [ByteArk Coding Plan supports mainstream large models like Doubao, GLM, DeepSeek, Kimi, MiniMax, officially supplied, stable and reliable. Configuration Guide Β₯9.9/month Subscribe Now](https://maas.xfyun.cn/modelSquare?ch=maas_lm_l2E)
← Java String TrimRef Emoji β†’