public class StringAPIDemo02{ public static void main(String args[]){ String str1 = "hello" ; // 定义String对象 System.out.println(str1.charAt(3)) ; // 取出字符串中第四个字符 } }; //源代码片段来自云代码http://yuncode.net