getBoolean(String str) and valueOf(String str) of Boolean class gives different output

后端 未结 5 1933
野性不改
野性不改 2020-12-29 18:38

I am surprised to know that getBoolean() and valueOf() method returns different results for the same input string.

I have tried to pass the

5条回答
  •  礼貌的吻别
    2020-12-29 19:06

    class Boo1
    {    
        public static void main(String[] args)
        {    
           System.setProperty("true","true");
           System.setProperty("false","true");
    
           boolean d=Boolean.getBoolean("true");
    
           System.out.println(d);   
       }
    }
    

提交回复
热议问题