下载此文档

含有正则的笔记Containsregularnotes.doc


文档分类:IT计算机 | 页数:约20页 举报非法文档有奖
1/20
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/20 下载此文档
文档列表 文档介绍
含有正则的笔记(Contains regular notes)
Practice:
Java design pattern singleton (Singleton)
A class requires only one object a teacher, a network management
Requirements: the number of students to be fixed, the teacher shared all classrooms, all network management Classroom sharing, and will not change
(encapsulation, inheritance, arrays, static, final, abstract)
Rewriting is the overload that occurs between father and son classes, and is overridden, overridden, or overridden in this class
Run with packets: compile the source file, run the outermost package?
Javac, test, java, -d. Or, javac, -d. Test, java, -d, javac, Testi, java,
Java com. tarena. test. Testi
April 2nd
Clone:
There are two ways to implement cloning: to implement the interface Cloneable: to override the clone method permission; protected to public
Shallow clones are cited, and deep cloning is the object of memory
Equals object is used to achieve the "=二”
==always better than the memory address equals method can be changed (rewritten)
Public, Boolean, equals (Object, obj) {
If (obj = = null) {
Return false: ) else if (obj, instanceof, Student) {
Student st = (Student) obj:
Return st. id = = this, id;
Return / st. name, equals (name); adjusting the ratio of String
}// type determines the equals plus ID, HashCode should also be decided
Return false: / / or compiled to
}// overrides the equals method requires special skilled
Public, int, hashCode () {
In accordance with the HashCode agreement / need to override the. Equals HashCode rewrite rewrite
Int type=41: / / just a prime number represents a type
Return type*97+id; / / reduce weight rate is not absolute
//return, type*97+name. hashCode ();
The Java language interval is before closing and then opening
The String class method * charAt (); endsWith (), startsWith () determines whether a string starts or ends with a string; equal signor ecase (string anotherstring)区分火不区分大小写; getbytes ()把 string 拆成 byte [] : indexof (string str)在

含有正则的笔记Containsregularnotes 来自淘豆网www.taodocs.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数20
  • 收藏数0 收藏
  • 顶次数0
  • 上传人pppccc8
  • 文件大小69 KB
  • 时间2022-07-01