Advertisements
Advertisements
Question
Give reason whether the following assignment is correct or not.
String b = "true";
Answer in Brief
Solution
This assignment is correct since "true" is a string literal, not a boolean literal, and it is contained in double quotes. It was correctly assigned to the String variable.
shaalaa.com
Is there an error in this question or solution?
Chapter 1.03: Values and Data Types - EXERCISES [Page 33]