4.Java common class

Class method 1.number

  1. xxxValue () object into a number of data type XXX
  2. compareTo()  
  3. equals()    
  4. valueOf()   
  5. toString () Returns a string value
  6. parselnt () parses the string to an int
  7. abs()   
  8. ceil()
  9. floor()
  10. Rint ()
  11. round)
  12. (I)
  13. max
  14. exp()
  15. sqrt () square root arithmetic
  16. without()
  17. cos()
  18. tan()
  19. asin()
  20. acos()
  21. Atan ()
  22. atan2 () Cartesian coordinates into polar coordinates
  23. toDegree () parameter turn angle
  24. toRadians () angle into radians
  25. random () Random Number

2.character class

  1. isLetter () whether the letter
  2. isDigit () whether the numeric characters
  3. isWhitespace () whether it is a space
  4. isUpperCase () whether uppercase
  5. isLowerCase () whether lowercase letters
  6. toUpperCase () specified in uppercase letters
  7. the toLowerCase () letters designated in lowercase
  8. toString () Returns a string

3.string class

Note: string can not be modified once created class, StringBuffer, StringBuilder class can be modified

https://www.w3cschool.cn/java/java-string.html

 

4.StringBuffer、StringBuilder类

  1. StringBuilder thread-safe, fast (without regard to security, there is most often the case)
  2. StringBuffer thread-safe, slow

Note: StringBuffer and StringBuilder creation, but also to modify

If the required thread-safe, use the StringBuffer, fast speed, if required, use StringBuiler

(Thread-safe: when multi-threaded access, the use of locking mechanism, when one thread to access the data class, protected, other threads can not be accessed finish reading this thread know, other threads to use does not appear or inconsistent data. data pollution. thread-safe, just do not provide data access protection, there may be multiple threads to change the data has caused the resulting data is dirty data)

https://www.w3cschool.cn/java/java-stringbuffer.html

 

Guess you like

Origin www.cnblogs.com/123lmliang/p/11273070.html