Java System Class

Source: Internet
Author: User
Tags time in milliseconds

1  Packagedemo04;2 3 //because the constructor method is private, the system class cannot create the object, but its static method can be accessed through the class name4  Public classSystemdemo {5      Public Static voidMain (string[] args) {6         //Static Long Currenttimemillis () returns the current time in milliseconds7         8         //Get program run time End-start9         LongStart =System.currenttimemillis ();Ten          for(inti = 0; I < 10000; i++) { One System.out.println (i); A         } -         LongEnd =System.currenttimemillis (); -System.out.println (end-start); the          -         //static void GC () running the garbage collector - System.GC (); -          +         //static Properties GetProperties () determines the current system Properties - System.out.println (System.getproperties ()); +          A         //static void Arraycopy (object src, int srcpos, object dest, int destpos, int length) at         //(source array, start position, target array, target array start position, copy array elements) copy an array from the specified source array, copy from the specified position, and end at the specified position in the destination array -         int[] src = {1,2,3,4,5,6}; -         int[] Dest = {7,8,9}; -System.arraycopy (SRC, 1, dest, 0, 2); -         //[2,3,9] -          for(inti = 0; i < dest.length; i++) { in System.out.println (Dest[i]); -         } to          +         //static void exit (int status) terminates the currently running Java virtual machine -System.exit (0); theSystem.out.println ("will not execute here"); *     } $}

Java System class

Related Article

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.