Util common Classes

Source: Internet
Author: User

1.Date

Date D=new date ();//Create a Date Object

SimpleDateFormat sdf=new SimpleDateFormat (yyyy year MM DD Day e hh:mm:ss);//Create a simple Date format object

String Name=sdf.format (d); Creates a string object on Date Object D in the specified format

2Math

1.ceil (): The minimum value of an integer greater than it

2.foor (): The minimum value of the integer less than it

3.round (): Rounding

4.pow (): Power exponent

3,. Runtime ()

Run the exe file, look under the current path, if not found, and then look under path path, it is a singleton design mode (constructor privatization)

such as this Runtime r=runtime.getruntime;

Process p=r.exec ("notepad.exe abc.txt")

P.destroy ()//Kill process

4.System

system.in//input from keyboard

system.out//from console output

Properties p= system.getpropertise//System attribute Class Propertise It is a subclass of Hashtable is also a key-value mapping relationship

System.getproperty (key); Get value by key

5.Calendar class

is also the class of the operation date

You need to do a good mapping between the month property and Day_of_wee. (Not quite understand)

Util common Classes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.