The System class for Java

Source: Internet
Author: User

1.System class overview

The system class contains some useful class fields and methods. It cannot be instantiated.


2. Member Methods

public static void GC () runs the garbage collector

public static void exit (int status) terminates the currently running Java Virtual machine

public static long Currenttimemillis () returns the current time of the millisecond unit

public static void Arraycopy (Object src,int srcpos,object desc,int descpos,int length) copies an array from the specified source array, starting at the specified position, Ends at the specified position in the destination array.

package cn;/** * system class  *  *   Member Method  *  PUBLIC STATIC VOID GC ()   *   Run garbage collector  *       public static void exit (Int status)   *        terminate a currently running Java Virtual machine  *      public static  Long curenttimemillis ()   *       returns the current time of the millisecond unit  *       public static void arraycopy (Object src,int srcpos,object  desc,int descpos,int length)  * Copy an array from the specified source array, copying starts at the specified position and ends at the specified position in the destination array  */public  Class systemdemo1 {public static void main (String[] args)  { System.out.println (System.currenttimemillis ());//1476179027207system.out.println ("Hello");//hellosystem.exit (0 ); SYSTEM.OUT.PRINTLN ("World");/}} 


This article is from the "11831428" blog, please be sure to keep this source http://11841428.blog.51cto.com/11831428/1860770

The System class for Java

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.