charAt()
char charAt(int index)
- Returns the char value in this sequence at the specified index.
public class Main {
public static void main(String[] argv) {
StringBuilder sb = new StringBuilder();
sb.append("java2s.com");
char ch = sb.charAt(0);
System.out.println(ch);
}
}
The output:
j