13.2System类中的常用方法
生活随笔
收集整理的這篇文章主要介紹了
13.2System类中的常用方法
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
package cn.chen.systemclass;import java.util.Properties;/** System 類中的主要方法:* static void arraycopy(Object src, int srcPos, Object dest, int destPos, int length) * 從指定源數組中復制一個數組,復制從指定的位置開始,到目標數組的指定位置結束。* static void exit(int status) * 終止當前正在運行的 Java 虛擬機。 * static void gc() * 運行垃圾回收器。 * static Map<String,String> getenv() * 獲得環境變量* static Properties getProperties() * 獲取系統的屬性值* */
public class demo1 {public static void main(String[] args) {// TODO Auto-generated method stubProperties properties = System.getProperties();//properties.list(System.out);String value = System.getProperty("os.name");System.out.println("當前系統"+value);}}
總結
以上是生活随笔為你收集整理的13.2System类中的常用方法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 13.1StringBuffer与Str
- 下一篇: 13.3Runtime 类中的主要方法