Java reference
Java methods, syntax, and runnable examples
Search commonly used Java methods and language features, check return types, copy examples, and send selected code directly to the compiler.
Results
toCharArray()
Converts the string into a new character array.
Best use
Use this entry when you need the syntax, return type, and a runnable example quickly.
Syntax
char[] toCharArray()Return type
char[]
Java example
String str = "Hello";
char[] chars = str.toCharArray();
for (char c : chars) {
System.out.println(c);
}Advertisement
Java APIs and syntax covered
The reference covers frequently used Java language features and standard-library APIs. Each entry includes a concise explanation, syntax, and an example intended for quick lookup while coding.
String Methods
21 entries
Scanner Methods
9 entries
File Methods
9 entries
Exception Handling
6 entries
Number Methods
8 entries
Math Methods
8 entries
ArrayList Methods
9 entries
HashMap Methods
9 entries
Related Java guides and tools
Java String methods
Learn how common String operations work before using them from the reference.
Arrays and ArrayList
Study collection fundamentals, iteration, and common list operations.
Java regex tester and guide
Build patterns, inspect matches, and generate Java Pattern code.
Java compiler
Run a complete Main.java file and inspect standard output and errors.