Working on a page-passing Boolean type of data problem that needs to be judged in code that cannot be null, think about the difference between a Boolean and a Boolean?
Boolean is the basic data type
The Boolean is its wrapper class, like any other class, has attributes that have methods that can be new, for example:
Boolean flag = New Boolean ("true"); A Boolean is not possible!
Boolean is a Boolean instantiation of an object class, just as an integer corresponds to an int
Since jdk1.5.0 and above, Boolean is the same as Boolean on "assignment" and
That is you: Boolean B1 = true; or Boolean b2 = true; All can.
The only thing that can be used on a Boolean is when you get a value from a list or hash table.
For example, Boolean t = false;
Map map = new HashMap ();
Map.put ("T", t);
Then you can get the value only with
Boolean T1 = (Boolean) map.get (t); The preceding can only be cast with a Boolean and cannot use Boolean.
For example:
Boolean B1 = false;
Boolean b2 = new Boolean ("false");
System.out.println (B1 = = b2); True
Differences between Boolean and Boolean types of data