java-Common Classes

Source: Internet
Author: User

1.java.lang.runtime

Each Java application has a Runtime class instance that enables the application to connect to the environment in which it is running.

The current runtime can be obtained by means of a getRuntime method . The application cannot create its own instance of the Runtime class

1.1 Member Methods :

Process exec (String command),//exec ("notepad.exe Demo.java") Open the Demo file of the current directory with the Notepad program

Process exit (int status)// terminates the currently running Java virtual machine by starting the shutdown sequence of the virtual machine.

void GC (); Run the garbage collector

2.java.util.calendar

A Calendar class is an abstract class that is a specific moment with a set of such things as,, YEAR MONTH DAY_OF_MONTH ,HOUR

日历字段the conversion between the etc. provides some methods and provides methods for manipulating calendar fields, such as getting the date of the next week.

Instantiated object: Calendar RightNow = Calendar.getinstance ();

3.java.util.date   

Construction method: Date ()

4.java.text.simpledateformat

Construction method: SimpleDateFormat sdf=new SimpleDateFormat ("Yyyy-dd-dd");
SimpleDateFormat sdf2 = new SimpleDateFormat ("yyyy. Mm.dd ");

Member Method: String Format (date date)

Sdf2.format (date);//Returns a date string in SDF2 format

java-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.