代碼
提交代碼
public class StringMethod2 {
public static void main(String[] args) {
String str = "I love Java";
char c = str.charAt(7);
System.out.println("索引位置為7的字符為:" + c);
}
}
運(yùn)行結(jié)果