Java Java API
java.lang.System
public static String clearProperty(String key)
Removes the system property indicated by the specified key.
package com.logicbig.example.system;public class ClearPropertyExample { public static void main(String... args) { String property = System.getProperty("user.language"); System.out.printf("before clearProperty() : %s%n", property); String s = System.clearProperty("user.language"); System.out.printf("clearProperty() returned : %s%n", s); property = System.getProperty("user.language"); System.out.printf("after clearProperty() : %s%n", property); }}
before clearProperty() : enclearProperty() returned : enafter clearProperty() : null