1.

State the difference between a boolean literal and character literal.

Answer»

The value true or false that is stored within a boolean variable is called boolean literal or a boolean constant, whereas any possible character that can be typed or generated through a keyboard and stored within single quotation marks is called character literal or character constant. 

For example : 

boolean s=true; //here true is a boolean literal 

char ch=‘A’; //here ‘A’ is a character literal



Discussion

No Comment Found

Related InterviewSolutions