fork(1) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. Properties properties = new Properties();
  13. String key="7";
  14. String value=null;
  15.  
  16. properties.setProperty("7", "Unlock");
  17.  
  18. System.out.println(properties.getProperty("7")); //print **Unlock**
  19. System.out.println(key); //print **7**
  20.  
  21.  
  22. System.out.println(value); //VALUE IS NULL HERE.
  23. value = properties.getProperty(key); //NOW VALUE IS INITIALIZED
  24.  
  25.  
  26. System.out.println("Value after initialization: "+value);
  27. }
  28. }
Success #stdin #stdout 0.08s 380160KB
stdin
Standard input is empty
stdout
Unlock
7
null
Value after initialization: Unlock