String类的转换功能:package com.itheima_05;/* * String类的转换功能: * char[] toCharArray():把字符串转换为字符数组 * String toLowerCase():把字符串转换为小写字符串 * String toUpperCase():把字符串转换为大写字符串 * * 字符串的遍历: * A:length()加上charAt() * B:把字符串转换为字符数组,然后遍历数组 */public class StringDemo { public static void main(String[] args) { //创建字符串对象 String s = "abcde"; //char[] toCharArray():把字符串转换为字符数组 char[] chs = s.toCharArray(); for(int x=0; x
数组里面的长度是属性。String类里面的长度是方法。