Problem Statement - Marking Literals and Its Type in a program
Write down all the literals in the given program and tell its type of literal.
Solution
Run Output
149.5550012207031
You are a smart programmer = true
101 – Integer Literal
3.21 – decimal/fractional/real literal
45.345f – decimal/fractional/real literal
u0061 – Character Literal
You are – String Literal
smart programmer – String Literal
true – Boolean Literal
Common Errors
- Student often forget that a boolean literal can be a part of println() method argument also.
sunmitra| Created: 13-Mar-2018 | Updated: 13-Mar-2018|
Post Views:
702