Is there a valid reason to code a false boolean as “Boolean.FALSE” in java?

No, that's completely pointless. It would make sense to use.

No, that's completely pointless. It would make sense to use: // Note capital B Boolean myFlag = Boolean. FALSE; to avoid the call to Boolean.

ValueOf (autoboxing) but in your code there is no boxing, and their suggestion introduces an unnecessary unboxing operation. As ever though, if someone suggests something and you don't understand why, your first port of call should be asking them.

Additionally, if you have boolean myFlag = false;, you should just use boolean myFlag; – Danail Nachev Jul 19 '11 at 13:27 8 @Danail: Not if it's a local variable. – Jon Skeet Jul 19 '11 at 13:30 6 +1 for "your first port of call should be asking them" – Chris Jul 19 '11 at 13:37 Yes, this was my thought too. I don't know if the compiler would automatically unbox it so that it would be converted but I figured there was no real point to it.

Also the code standards doc says nothing about it, so I will just argue back with them that it's pointless. – Rocky Triton Jul 19 '11 at 13:48.

There's nothing wrong with using keyword false. In fact, in your code you'd be silly to use Boolean. False since there is an implicit auto unboxing that has to occur to assign it to your primitive field/variable (Boolean.

False is a Boolean and not a boolean).

It doesn't make much sense as a complaint since Boolean. FALSE is unboxed to false anyway. But perhaps ask the people telling you to change the code why?

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions