2.声明
以下是声明java.lang.String.charAt()方法
public char charAt(int index) 3.参数index -- 这是该指数的char值
4.返回值 此方法返回这个字符串的指定索引处的char值。第一个char值的索引为0. 5.异常IndexOutOfBoundsException -- 如果index参数为负或不小于该字符串的长度.
6.实例 public class Test { public static void main(String[] args) { String s ="abc"; System.out.println(s.charAt(1)); }}运行结果是: b免责声明:文章源自网络,版权归原作者所有,如有侵犯联系删除。