String class
Construction method:
StringBuffer class
String with buffer. Buffer, buffer (cache), as long as you see the word Buffer, it is synonymous with "efficiency".
The difference between String and StringBuffer: It is recommended to use StringBuffer for frequently changing strings.
Random class
Main method: nextInt(int n) [return int type]
Description: Returns a pseudo-random number, which is from An int value uniformly distributed between 0 (inclusive) and the specified value (exclusive) taken from a sequence of random number generators.
Date class (SimpleDateFormat class, Calendar class)
The Date class represents the date.
Class SimpleDateFormat represents the conversion of simple date formats. The method format converts Date into String; the method parse converts String into Date.
Calendar-like objects can generate all calendar field values required to implement date-time formatting for a specific language and calendar style.
Timer class (TimerTask class)
The Timer class represents the timing class, and the TimerTask class represents the timing processing class
Recommended tutorial: Java tutorial
The above is the detailed content of What are the commonly used classes in java. For more information, please follow other related articles on the PHP Chinese website!