13.2System类中的常用方法
生活随笔
收集整理的這篇文章主要介紹了
13.2System类中的常用方法
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
package cn.chen.systemclass;import java.util.Properties;/** System 類中的主要方法:* static void arraycopy(Object src, int srcPos, Object dest, int destPos, int length) * 從指定源數(shù)組中復(fù)制一個(gè)數(shù)組,復(fù)制從指定的位置開始,到目標(biāo)數(shù)組的指定位置結(jié)束。* static void exit(int status) * 終止當(dāng)前正在運(yùn)行的 Java 虛擬機(jī)。 * static void gc() * 運(yùn)行垃圾回收器。 * static Map<String,String> getenv() * 獲得環(huán)境變量* static Properties getProperties() * 獲取系統(tǒng)的屬性值* */
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("當(dāng)前系統(tǒng)"+value);}}
總結(jié)
以上是生活随笔為你收集整理的13.2System类中的常用方法的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 13.1StringBuffer与Str
- 下一篇: 13.3Runtime 类中的主要方法