Two ways to declare an array:
1. Assign values when declaring:
For example: int[] Socre = {60,38,92,51};
Int[] score = new int[]{60,38,92,51};
2. Assign values after the declaration:
int[] Socre = new Int[4];
3. Note: Array declaration to tell the length of the array, subscript is starting from 0, to the length of the array-1 end
4. Declaration of two-D array: int[][] Socre = {{60,38,24}{15,28,92},{83,67,21}};
Remember the outside control line, inside the control column
5.Arryas use sort () order from small to large
CopyOf () Action array The first parameter is the array name to change, and the second parameter is the length of the array you want to modify
Fill () fills here refers to replacing all values
BinarySearch () Find array subscript position
6.String using Length () to get the string length
Split () Split string returns an array
CharAt () Gets the characters in the string
IndexOf () Gets the index of the character where the result is the INT type
SUBSTRING () passes a parameter representing the beginning of the position to the end
SUBSTRING () Two parameters represent the end of the first position to the second position-1 (remember left contains, right does not contain)
StartsWith () to determine the starting position of a string returns a Boolean value
EndsWith () to determine the end position of a string returns a Boolean value
string concatenation of strings with + on it;
7.StringBuffer StringBuffer Stitching string with append (),
StringBuffer converted to string by object name. ToString ()
Focus: The difference between the two:
Both are used to manipulate strings
string concatenation of strings, not stitching once is equivalent to creating a string object, consuming memory space
StringBuffer stitching strings with append (), only creates an object, does not consume space
StringBuilder compared to stringbuffer StringBuilder thread-safe, slow execution,
StringBuffer thread is not secure, execution speed is fast
Arrays and common classes