mention the types of variables in scala? And what is the difference between them?
Answer / Chandrajeet Verma
In Scala, there are three main types of variables: Val, Var, and Def. nnVal: It is a constant variable that cannot be reassigned after being initialized.nVar: It is a mutable variable that can be reassigned multiple times.nDef: It is a shortcut for lazy variables (val with a delayed initialization).
| Is This Answer Correct ? | 0 Yes | 0 No |
What is the use of ‘???’ in Scala-based Applications?
What is the difference between apply and unapply methods in scala?
What do you mean by option in scala and why it is used?
Why do we need app in scala?
Why scala prefers immutability?
Is scala better than java?
What is the best Framework to generate REST API documentation for Scala-based applications?
What does raw method in scala string interpolation?
What is scala trait?
What is a stream in scala?
Explain the advantage of scala over other programming languages?
What are option, some and none in scala?