Search code examples
javasystemgetproperty

Using System.getProperty as a condition


Is it OK to use xxx.equals(System.getProperty(key)) as a condition? Or Am I supposed to use the properties for some other purposes?

I have been reading these;

http://download.oracle.com/javase/tutorial/essential/environment/sysprop.html

http://download.oracle.com/javase/6/docs/api/java/lang/System.html

however, I'm a little confused on its usage. Some more links or some code samples would be very helpful.

Thank you...


Solution

  • As everybody said yes you can do this.

    Regarding:

    however, I'm a little confused on its usage. Some more links or some code samples would be very helpful.

    try this link, you might find it helpful.