What is a boolean?

1 answer

Answer

1130760

2026-05-15 08:46

+ Follow

A Boolean is a variable that can hold the value true or false. In most implementations, true is the all-ones bit pattern while false is the all-zeroes bit pattern. As a signed integer in twos-complement notation these patters represent -1 and 0 respectively. However, numeric values can and often do implicitly convert to a Boolean such that non-zero values are always true while zero is always false. For typical container objects (including strings), an empty container implicitly converts to false while a non-empty container implicitly converts to true.

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.