0 votes
in Scala Constructs by
Explain what you mean by literals and write its types.

1 Answer

0 votes
by

Literals, or constants, are any constant value that can be assigned to a variable. A literal is a set of symbols used to describe a constant value in the code. They are classified into the following types:   

  1. Integer literals 
  2. Floating point literals 
  3. Boolean literals 
  4. Symbol literals 
  5. Character literals 
  6. String literals 
  7. Multi-Line strings 
...