跳到主要内容

📖 Java 参考手册

📖 Java 参考手册

Java字符串方法

  1. Java字符串split()方法 Splits the string at the specified string (regex)
  2. Java字符串compareTo()方法 Compares two strings in the dictionary order
  3. Java字符串compareToIgnoreCase()方法 Compares two strings ignoring case differences
  4. Java字符串length()方法 Returns the length of the string
  5. Java字符串replace()方法 Replace all matching characters/text in the string
  6. Java字符串replaceAll()方法 Replace all substrings matching the regex pattern
  7. Java字符串substring()方法 Returns a substring from the given string
  8. Java字符串equals()方法 Compares two strings
  9. Java字符串equalsIgnoreCase()方法 Compares two strings ignoring case differences
  10. Java字符串contains()方法 Checks whether the string contains a substring
  11. Java字符串indexOf()方法 Returns the index of the character/substring
  12. Java字符串trim()方法 Removes any leading and trailing whitespace
  13. Java字符串charAt()方法 Returns the character at the given index
  14. Java字符串toLowerCase()方法 Converts characters in the string to lower case
  15. Java字符串concat()方法 Concatenates two strings and returns it
  16. Java字符串valueOf()方法 Returns the string representation of a value
  17. Java字符串matches()方法 checks whether the string matches the given regex
  18. Java字符串startsWith()方法 Checks if the string begins with the given string
  19. Java字符串endsWith()方法 Checks if the string ends with the given string
  20. Java字符串isEmpty()方法 Checks whether a string is empty or not
  21. Java字符串intern()方法 Returns a canonical representation of the string
  22. Java字符串getBytes()方法 Encodes the string into a sequences of bytes
  23. Java字符串contentEquals()方法 Checks whether the string is equal to charSequence
  24. Java String hashCode()方法 Returns a hash code for the string
  25. Java String join()方法 Joins the given strings using the delimiter
  26. Java 字符串 replaceFirst() 方法 Replace the first matching substring
  27. Java 字符串 subSequence() 方法 Returns a subsequence from the string
  28. Java 字符串 toCharArray() 方法 Converts the string to a char array
  29. Java 字符串 format() 方法 Returns a formatted string

Java ArrayList 方法

  1. Java ArrayList add() 方法 inserts the element to the arraylist
  2. Java ArrayList addAll() 方法 adds all elements of a collection to arraylist
  3. Java ArrayList clear() 方法 removes all the elements from arraylist
  4. Java ArrayList clone() 方法 makes a copy of the array list
  5. Java ArrayList contains() 方法 checks if the element is present in the arraylist
  6. Java ArrayList get() 方法 returns the element present in the specified index
  7. Java ArrayList indexOf() 方法 returns the position of the specified element
  8. Java ArrayList removeAll() 方法 removes multiple elements from the arraylist
  9. Java ArrayList remove() 方法 removes the single element from the arraylist
  10. Java ArrayList size() 方法 returns the length of an arraylist
  11. Java ArrayList isEmpty() 方法 checks if the arraylist is empty
  12. Java ArrayList subList() 方法 returns a portion of the arraylist
  13. Java ArrayList set() 方法 replace the single element from an arraylist
  14. Java ArrayList sort() 方法 sorts the arraylist according to specified order
  15. Java ArrayList toArray() 方法 converts an arraylist to an array
  16. Java ArrayList toString() 方法 converts the arraylist into a String
  17. Java ArrayList ensureCapacity() 方法 set the size of an araylist
  18. Java ArrayList lastIndexOf() 方法 returns position of last occurrence of the element
  19. Java ArrayList retainAll() 方法 retains only the common elements
  20. Java ArrayList containsAll() 方法 checks if a collection is a subset of arraylist
  21. Java ArrayList trimToSize() 方法 trims the capacity of arraylist equal to the size
  22. Java ArrayList removeRange() 方法 removes a portion of the arraylist
  23. Java ArrayList replaceAll() 方法 replace all elements from the arraylist
  24. Java ArrayList removeIf() 方法 removes element that satisfy the condition
  25. Java ArrayList forEach() 方法 performs an action to all elements of arraylist
  26. Java ArrayList iterator() 方法 returns an iterate to loop through the ArrayList

Java HashMap 方法

  1. Java HashMap clear() 方法 remove all elements from HashMap
  2. Java HashMap clone() 方法 makes the copy of the hashmap
  3. Java HashMap isEmpty() 方法 checks if the HashMap is empty
  4. Java HashMap size() 方法 returns the number of items in HashMap
  5. Java HashMap put() 方法 inserts the specified item to the hashmap
  6. Java HashMap putAll() 方法 inserts all items from a map to HashMap
  7. Java HashMap putIfAbsent() 方法 inserts item if the key is not already present
  8. Java HashMap remove() 方法 removes the mapping for the specified key
  9. Java HashMap containsKey() 方法 checks if the specified key is present in HashMap
  10. Java HashMap containsValue() 方法 checks if HashMap contains the specified value
  11. Java HashMap replace() 方法 replaces the value for the specified key
  12. Java HashMap replaceAll() 方法 replaces all values with
  13. Java HashMap get() 方法 returns the value using the specified key
  14. Java HashMap getOrDefault() 方法 returns specified default value if key not found
  15. Java HashMap forEach() 方法 performs the action to all entries of HashMap
  16. Java HashMap entrySet() 方法 returns a set view of all entries
  17. Java HashMap keySet() 方法 returns a set view of all the keys of HashMap
  18. Java HashMap values() 方法 returns a view of all values present in HashMap
  19. Java HashMap merge() 方法 merges the specified mapping to the HashMaps
  20. Java HashMap compute() 方法 computes a new value for the specified key
  21. Java HashMap computeIfAbsent() 方法 computes value if mapping for key is not present
  22. Java HashMap computeIfPresent() 方法 computes a value for the mapping if key is present

Java 数学方法

  1. Java Math abs() 方法 returns the absolute value of a number
  2. Java Math acos() 方法 returns the arc cosine of the specified value
  3. Java Math addExact() 方法 adds the specified numbers and returns it
  4. Java Math asin() 方法 returns the arc sine of the specified argument
  5. Java Math atan() 方法 returns the inverse tangent function of a value
  6. Java Math cos() 方法 returns the cosine of the specified angle
  7. Java Math sin() 方法 returns the sine of the specified angle in radians
  8. Java Math tan() 方法 returns the tangent value of the specified angle
  9. Java Math sinh() 方法 returns the hyperbolic sine of the specified value
  10. Java Math cosh() 方法 returns hyperbolic cosine of the specified value
  11. Java Math tanh() 方法 returns hyperbolic tangent of the specified value
  12. Java Math sqrt() 方法 returns the square root of the specified number
  13. Java Math cbrt() 方法 returns the cube root of the specified number
  14. Java Math pow() 方法 returns first argument raised to power of second
  15. Java Math subtractExact() 方法 subtracts the specified numbers and returns it
  16. Java Math multiplyExact() 方法 multiplies the specified numbers and returns it
  17. Java Math incrementExact() 方法 adds 1 to the specified number and returns it
  18. Java Math decrementExact() 方法 subtracts 1 from specified number and returns it
  19. Java Math negateExact() 方法 negates the specified variable and returns it
  20. Java Math toIntExact() 方法 returns the int value from specified long argument
  21. Java Math min() 方法 returns the smaller value among the arguments
  22. Java Math max() returns the maximum value among the arguments
  23. Java Math ceil() rounds the specified value upward
  24. Java Math floor() 方法 rounds the specified value downward and returns it
  25. Java Math round() 方法 rounds the specified argument and returns it
  26. Java Math toRadians() 方法 converts angle from degree to radians
  27. Java Math toDegrees() 方法 converts angle from radians to degrees
  28. Java Math atan2() 方法 returns θ converting coordinates (x, y) to (r, θ)
  29. Java Math copySign() 方法 copies the sign of second argument to the first
  30. Java Math exp() 方法 returns e raised to power of given value
  31. Java Math expm1() 方法 returns e raised to power of given value minus 1
  32. Java Math getExponent() 方法 returns the unbiased exponent of specified number
  33. Java Math hypot() 方法 computes the hypotenuse of a right-angle triangle
  34. Java Math IEEEremainder() 方法 returns the remainder as per the IEEE 754 standard
  35. Java Math log() 方法 returns the natural logarithm of specified value
  36. Java Math log10() 方法 returns the base 10 logarithm of specified value
  37. Java Math log1p() 方法 returns natural logarithm of (specified value + 1)
  38. Java Math nextAfter() 方法 returns number adjacent to specified number
  39. Java Math nextUp() 方法 returns number greater than and adjacent to value
  40. Java Math nextDown() 方法 returns number less than and adjacent to the value
  41. Java Math rint() 方法 returns closest mathematical integer of the vaue
  42. Java Math.random() 方法 returns a random value between 0.0 and 1.0

Java对象方法

  1. Java Object getClass() 方法 returns the class name of the object
  2. Java Object hashCode() 方法 returns the hashcode value of the object
  3. Java Object toString() 方法 converts an object into the string
  4. Java Object equals() 方法 checks if two objects are equal
  5. Java Object clone() 方法 creates a copy of the object