[Solved] How can I check whether the variable have value or not? [closed]


You’re creating a Boolean object representing a false value, because the string parameter is not “true” (ignoring case).

Boolean b=new Boolean("T87778rue");

Next, you check whether the Boolean object representing false is equal to 10. It’s not.

int i = 10;
System.out.println(b.equals(i));

From the Boolean constructor API documentation:

Boolean(String s)
Allocates a Boolean object representing the value true if the string argument is not null and is equal, ignoring case, to the string “true”.

solved How can I check whether the variable have value or not? [closed]