Java学习笔记3 --- 常用类

一、学习笔记:

  1. 【IntelliJ IDEA快捷键】alt + 7 — 查看文件内所有已经声明的方法

  2. String类 — 不可变字符序列

    • equalsIgnoreCase
    • indexOf
    • lastIndexOf
    • trim
    • split
    • startWith/endWith
    • toLowerCase/toUpperCase
    • getChars() 方法将字符从字符串复制到目标字符数组
      public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)
      srcBegin – 字符串中要复制的第一个字符的索引。
      srcEnd – 字符串中要复制的最后一个字符之后的索引。
      dst – 目标数组。
      dstBegin – 目标数组中的起始偏移量。
  3. StringBuilder — 线程不安全,效率高

    • append
    • delete(int start,int end)【System.arraycopy(value, start+len, value, start, count-end);】
    • reverse
  4. SrtingBuffer — 线程安全,效率低

二、注释、

[其他] Employee - 员工,职员

三、参考资料

【视频】Java课程 Java300集大型视频教程
《Java核心技术 卷1》

猜你喜欢

转载自blog.csdn.net/qq_41359212/article/details/80502306