Boolean.getBoolean("myvariable"); // where myvariable has been defined in the
// Environment variable as Variable name:
// myvariable
// and Variable Value:true
में ऊपर कॉल मुझे उत्पादन false
के रूप में देता है। अगर मैंBoolean.getBoolean() बनाम System.getenv() जावा
System.getenv("myvariable") ;
का उपयोग तो यह मेरे उत्पादन true
के रूप में देता है।
मुझे आश्चर्य है कि क्यों Boolean.getBoolean("myvariable")
काम नहीं कर रहा है।
मैं आपकी टिप्पणियों में 'testbootlog' का अनुमान लगा रहा हूं कि आम तौर पर' GetBoolean' को पास किया जा रहा है? –
यदि विधि में कुछ समझदार नाम 'Boolean.getSystemPropertyAsBoolean' था, जो सभी भ्रम को साफ़ करेगा :) –
हाँ @ जेम्स मॉन्टगेन, सुधार के लिए धन्यवाद। – Prakash