20165219 2017-2018-2 "Java Program Design" 6th Week study summary textbook Learning content Summary Eighth Chapter
String
Class
Common methods
public int length()
To find the string length
public boolean equals(String s)
Compares character sequences of two strings
public boolean startsWith(String s)
To public boolean endsWith(String s)
determine whether the prefix of the two-character sequence is the same
public int compareTo(String s)
Size comparison by dictionary order
public boolean contains(String s)
Determines whether the parameter S is included in the string
public int indexOf(String s)
, public int lastIndexOf(String s)
finds the character or substring in the current string, returns the position
public String substring(int startpoint)
Copy the characters from the StartPoint position to the last position
public String trim()
Remove the front and back spaces of the word character
StringBuffer
Class
Common methods
StringBuffer append(String s)
StringBuffer append(int n)
StringBuffer append(Object o)
public chat charAt(int n )
public void setCharAt(int n ,char ch)
StringBuffer insert(int index, String str)
public StringBuffer reverse()
The memory space of the entities of the StringBuffer class object can automatically change size
StringTokenizer
Class
Scanner
Class
Date
Class
Calender
Class
15th Chapter
Generics: Generic-class declaration:class 名称<泛型列表>
Linked list
Stack
Code Hosting
20165219 2017-2018-2 Java programming 6th Week of study summary