The system class for Java learning notes

Source: Internet
Author: User

General summary of System class

System class overview

Java.lang.System class, System attribute Information tool class

Common static methods:

1.

1  Public Static Long  Currenttimemillis ()

Gets the millisecond difference between the current system time and January 01, 1970 00:00

2.

 Public Static void exit (int status)

Used to end a running Java program, the parameter is a number, usually passed in 0 is normal, the other is the exception state

3.

 Public Static void GC ()

Used to run the garbage collector in the JVM to complete the cleanup of in-memory garbage

4.

 Public Static String GetProperty (String key)

Used to get system attribute information recorded in the specified key

Common parameters:

Os.name name of the operating system

File.separater file delimiter (in Unix System "/", on win system is "\")

Path.separater path Delimiter (":" In the UNIX System, ";" in the win system)

Line.separater line Delimiter ("/n" in Unix system, "\ r \ n" in Win system)

5.

 Public Static int int int length)

SRC: Source Array

Srcpos: source array start position

Dest: Target Array

Destpos: Destination array start position

Length: Number of elements to copy

The system class for Java learning notes

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.