Create a user-defined property or change the value of the current property in Java

Description

The following code shows how to create a user-defined property or change the value of the current property.

Example


//from  ww  w .jav  a  2 s.  com
public class Main {

  public static void main(String[] args) {
    System.setProperty("password", "myPassword");
    System.out.println(System.getProperty("password"));

  }

}

The code above generates the following result.





















Home »
  Java Tutorial »
    Development »




Java Algorithms
Java Clipboard
Java Compiler
Java Desktop
Java Virtual Machine
Java Math
OS
Random
Java Robot
Java RuntimeMXBean
Java Timer
Java UUID
Java Internationalization