java common class summary

The difference between String, StringBuffer, and StringBuilder
The content of String cannot be changed. Modifying the String variable will generate a new object and consume memory space.
StringBuffer is thread-safe and mainly uses its splicing string function append().
StringBuilder is not thread-safe, and its efficiency is slightly higher than StringBuffer. It is recommended to use StringBuilder first.

Math class usage
ceil(double a) Ceiling: take the value up (hehe, easy to remember)
floor(double a)
pow(3,2); 3 square
abrt(27); 27 cubic

Date, Calendar difference
parse(Stirng );
format(Date);

Calendar c = Calendar.getInstance();
c.get(Calendar.YEAR);
c.get(Calendar.MONTH)+1;
c.set(Calendar.YEAR,3000);
c.setTime (Date)
add(int field,int amount);

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327042740&siteId=291194637
Recommended