20165216 第六周作业

本周教材内容学习总结

第八章

 ->stinrg类

   Java中专门提供用来处理字符的类(不能有之类,包含于java.lang包中)

常量池

  在程序运行期间不能允许得到改变 类似于C语言前的 #define N 20;

构建字符串的两种方式

   String:

      String s = new String("we are students");

      String t = new String("we are students");

并置运算

     用“+”进行并置

    String you ="你";

    String hi ="你";

    String one =you+hi;

String类的常用方法

    1:public int length(); 获取一个字符串长度;

    2:public boolean equals(Sring s):判断对象的字符序列是否相同;

    3:public boolean startsWith(String s) 判断字符序列前缀是否为其指定序列;

Scanner类

  scanner将空格作为风格标记解析字符序列,next()方法返回。

十五章

  泛型

    建立具有类型安全的集合框架,如链表、散列映射等数据结构。用class 名称<泛型列表>,如

    People是名称,E是其中的泛类,这   --class People<E>.

 堆栈

   一种数据结构,只能在一端进行输入或输出数据的操作。

问题

 Sring testOne="你"+"好";的testOne

 和 String hi="你”;

      String you ="好";

String new =hi+you;中的new是不等价的。 

代码托管

 

 

posted @ 2018-04-08 20:21  许愿神王  阅读(111)  评论(0编辑  收藏  举报