Computer Science
Differentiate between String and Boolean constant
Values & Data Types Java
9 Likes
Answer
| String Constant | Boolean Constant |
|---|---|
| String Constants are written by enclosing a set of characters within a pair of double quotes. | A boolean constant can take only one of the two boolean values represented by the words true or false. |
| String Constants are assigned to variables of type String. | Boolean literals can only be assigned to variables declared as boolean |
Answered By
4 Likes