Close

Java - System.setProperty() Examples

Java Java API 


Class:

java.lang.System

java.lang.Objectjava.lang.Objectjava.lang.Systemjava.lang.SystemLogicBig

Method:

public static String setProperty(String key,
                                 String value)

Sets the system property indicated by the specified key.


Examples


package com.logicbig.example.system;

public class SetPropertyExample {

public static void main(String... args) {
System.setProperty("myProp", "myPropVal");

String prop = System.getProperty("myProp");
System.out.println(prop);
}
}

Output

myPropVal




See Also