热门

最新

红包

立Flag

投票

同城

我的

发布
weixin_55798945
对方正在输入...125
4 年前
trueweixin_55798945

public class class6_3

{

public static void main(String args[])

{

String s1=new String("我是中国人");

char[] c=s1.toCharArray();

System.out.println("数组c的长度为:"+c.length);

System.out.println(c);

System.out.println(new String(c));

String s2=new String(c,1,2);

System.out.println(s2);
}

}





运行结果:

  

数组c的长度为:5

我是中国人

我是中国人

是中

CSDN App 扫码分享
分享
评论
3
打赏
  • 复制链接
  • 举报
下一条:
大厂面试必问命令!不要再说不了解了!详解+实例!赶快来看下!
立即登录