0 votes
in Scala Constructs by
What are the types of Variables in Scala? And What is the difference between them?

1 Answer

0 votes
by

The Variables in Scala are mainly of two types:

Mutable Variables

  • We Declare Mutable Variables by using the var keyword.
  • The values in the Mutable Variables support Changes

Immutable Variables

  • We declare Immutable Variables using the val keyword.
  • The values in Immutable Variables do not support changes.

Related questions

0 votes
asked Sep 12, 2022 in Scala Constructs by Robin
0 votes
asked Sep 11, 2022 in Scala Constructs by sharadyadav1986
...