2016第五章 常用类.pptVIP

  • 9
  • 0
  • 约5.77千字
  • 约 25页
  • 2016-11-28 发布于北京
  • 举报
2016第五章 常用类

第五章 常用类 本章内容 数 组 字符串相关类( String、StringBuffer) 基本数据类型包装类 Math类 日期时间类 容器类 String 类 java.lang.String 类代表不可变的字符序列。 “xxxxx”为该类的一个对象。 String 类的常见构造方法: string(String original) 创建一个String对象为original 的拷贝。 String(char[] value) 用一个字符数组创建一个String对象 String(char[] value, int offset, int count) 用一个字符数组从offset项开始的count个字符序列创建一个String对象。 String 类举例 public class Test { public static void main(String[ ] args) { String s1=“hello”; String s2=“world”; String s3=“hello”; System.out.println(s1==s3); //true s1=new String (“hello”); s2=new

文档评论(0)

1亿VIP精品文档

相关文档