Java Data Type Tutorial - Java System.clearProperty(String key)








Syntax

System.clearProperty(String key) has the following syntax.

public static String clearProperty(String key)

Example

In the following code shows how to use System.clearProperty(String key) method.

//from w w w. j  a  v a  2s  . co m
public class Main {

   public static void main(String[] args) {

     String s = System.clearProperty("java.class.path");

     System.setProperty("user.dir", "C:/java2s.com");

     System.out.println(System.getProperty("user.dir"));
   }
}

The code above generates the following result.