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 file handling in scala?
What are implicit parameters in Scala?
Is Scala a Pure OOP Language? or Java a Pure OOP Language?
What is for-comprehension in scala?
What is exception handling in scala?
What is Scala anonymous function?
What is a collection in scala?
Is scala good for data science?
What is Monad in Scala?
What is a multiline expression in scala?
Mention Some keywords which are used by Java and not required in Scala? Why Scala does not require them?
What is scala closure?