Checks a System property value is true or not.
To check a System property has a value true or not we can use the Boolean wrapper class.
public class BooleanWrapper {
public static void main(String[] args) {
boolean bool = Boolean.getBoolean("os.name");
System.out.println(bool);
}
}
This would return true only if the System property exist and has a value equal to true. All other cases this would return false.
Tags: Boolean, Boolean examples, java.lang, java.lang.Boolean
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
Leave a Reply