[电脑基础知识]第5章字符串.pptVIP

  • 6
  • 0
  • 约1.24万字
  • 约 39页
  • 2018-02-15 发布于浙江
  • 举报
[电脑基础知识]第5章字符串

* * * * * * * * * * * * * * * * 例子5.9 class Example5_9 { public static void main(String args[]) { String s=清华大学出版社; char a[]=s.toCharArray(); for(int i=0;ia.length;i++) { a[i]=(char)(a[i]^t); } String secret=new String(a); System.out.println(密文:+secret); for(int i=0;ia.length;i++) { a[i]=(char)(a[i]^t); } String code=new String(a); System.out.println(原文:+code); }} String(byte[]) String(byte[],int offset,int length) 该构造方法使用平台默认的字符编码,用指定的字节数组的一部分,即从数组起始位置offset开始取length个字节构造一个字符串对象。 public byte[] getBytes() 使用平台默认的字符编码,将当前字符串转化为一个字节数

文档评论(0)

1亿VIP精品文档

相关文档