Boolean True or False

You set “b” to false and then changed it to true, so “b” is true. Then you set “toBe” to false. The next line does nothing, it returns true but doesn’t assign it to anything. Then you check if “b” equals true, and it does. So then you print out “toBe” which equals false. That is why false is printed.

Hope this helps!!

Browse More Popular Posts

Leave a Comment