Java source code examples

Java source code samples. Java code examples.

Gets the current System properties

1 votes Vote!!

import java.util.Enumeration;
import java.util.Properties;

public class SystemExample {
	public static void main(String[] args) {
		Properties prop = System.getProperties();

		Enumeration en = prop.keys();
		while(en.hasMoreElements()){
			String  key = (String) en.nextElement();
			String value = prop.getProperty(key);

			System.out.println(key +" = "+value);

		}
	}
}
  • Share/Bookmark

Tags: java.lang

Discuss This Code