Home > Java > JavaBase > What are the commonly used classes in java

What are the commonly used classes in java

王林
Release: 2019-11-16 13:49:50
Original
3901 people have browsed it

What are the commonly used classes in java

String class

Construction method:

What are the commonly used classes in java

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template