Array:
The definition of an array;
declaring arrays, allocating space, assigning values
Creation of array objects;
The element is an array of reference data types;
two-dimensional array;
Initialization of two-dimensional arrays;
Copy array: Arraycopy () method
string:
Java.long.String class, immutable character sequence
class Common methods:
public char charAt (int index)
Returns the index character in a string.
public int Length ()
Returns the length of the string.
public int indexOf (String str)
Returns the first position of STR in a string
public int indexOf (String str,int fromIndex)
Returns the first position of STR from Fromindex starting in a string
public boolean equalsignorecase (String another)
Compare strings with another (ignoring case)
Public String replace (char Oldchar,char Newchar)
Replace Oldchar characters with Newchar characters in strings
public boolean startsWith (String prefix)
Determines whether a string starts with a prefix string
public boolean endsWith (String suffix)
Determines whether a string ends with a suffix string
Public String toUpperCase ()
Returns a string that is the uppercase form of the string
Public String toLowerCase ()
Returns a string that is the lowercase form of the string
Public String substring (int beginindex)
Returns the substring from the beginning of the string to the end of the Beginindex
Public String substring (int beginindex,int endIndex)
Returns a substring of the string starting at Beginindex to the end of Endindex
Public String trim ()
Returns the string after the string is stripped of the beginning and trailing spaces
string length;
string comparison: Euqals () method
string concatenation: ①+ number ②concat () method
String Extraction:
public int indexOf (int ch), public int indexOf (String value)
Search for the first occurrence of the character ch (or string value)
public int lastIndexOf (int ch), public int lastIndexOf (String value)
Search for the last occurrence of the character ch (or string value)
Public String substring (int index)
Extracts the string portion starting from the position index
Public String substring (int beginindex, int endindex)
Extracting the string part between Beginindex and Endindex
Public String trim ()
Returns a copy of a call string that contains no spaces before or after it
StringBuffer and StringBuilder
variable sequence of characters
Difference: StringBuffer thread Safety, stringbuiler non-thread-safe;
Common methods:
Public StringBuffer Append (...)
You can add a sequence of characters to the object, returning the object reference after it is added
Public StringBuffer Insert (...)
Inserts a sequence of characters at the specified location for the StringBuffer object, returning the modified StringBuffer object reference
Public StringBuffer Reverse ()
Used to reverse the sequence of characters, returning the modified StringBuffer object reference.
Basic data type wrapper class:
These classes encapsulate a corresponding base data type value and provide it with a series of operations.
Math class:
A series of static methods are provided for scientific calculation, and the parameters and return value types of the methods are generally double.
ABS Absolute
Acos,asin,atan,cos,sin,tan
sqrt square root
Pow (double A, double b) A's power of B
Log Natural logarithm
Exp e is the base index
Max (double A, double b)
Min (double A, double b)
Random () returns the number 0.0 to 1.0
Long round (double a) double type data A is converted to long (rounded)
Todegrees (double angrad) radians-angle
Toradians (double angdeg) angle, radians
Java Learning-----02. Arrays and Strings