I can\'t seem to find a clear explanation as to what the difference is between these two. I\'d also like to point out that I don\'t really understand the difference between
Values are expressions that can't be evaluated any longer. That means, these are values:
Now, literals are fixed value expressions. From the above list, the following are literals:
So, x
has a value but not fixed.
Answering the main question, booleans can only have two literals: false
and true
, and every boolean variable is a boolean value.
You will see this in college in a compilers or computer semantics course, but the wikipedia pages linked here are very good if you still don't understand the difference.