Home
Recent Q&A
Java
Cloud
JavaScript
Python
SQL
PHP
HTML
C++
Data Science
DBMS
Devops
Hadoop
Machine Learning
Azure
Blockchain
Devops
Ask a Question
What are the types of Variables in Scala? And What is the difference between them?
Home
Scala Constructs
What are the types of Variables in Scala? And What is the difference between them?
0
votes
asked
Apr 21, 2022
in
Scala Constructs
by
sharadyadav1986
What are the types of Variables in Scala? And What is the difference between them?
scala-variables
scala-data-types
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Apr 21, 2022
by
sharadyadav1986
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.
Your comment on this answer:
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Related questions
0
votes
Q: What are different types of Scala variables?
asked
Sep 10, 2022
in
Scala Constructs
by
Robin
scala-variables
variables
scala
types
0
votes
Q: Explain the scope provided for variables in Scala.
asked
Apr 21, 2022
in
Scala Constructs
by
sharadyadav1986
scala-variables
0
votes
Q: Write different types of scope provided for variables in Scala.
asked
Sep 10, 2022
in
Scala Constructs
by
Robin
scala
variables-scope
0
votes
Q: How do we implement loops functionally in Scala? What is the difference between OOP and FP style loops?
asked
Sep 12, 2022
in
Scala Constructs
by
Robin
scala-loops
0
votes
Q: What is Null in Scala? What is null in Scala? What is difference between Null and null in Scala?
asked
Sep 12, 2022
in
Scala Constructs
by
Robin
null-scala
0
votes
Q: Is Scala Statically-Typed Language? What is Statically-Typed Language and What is Dynamically-Typed Language? What is the difference between statically typed and dynamically typed languages?
asked
Sep 12, 2022
in
Scala Constructs
by
Robin
scala
statically-typed-language
0
votes
Q: State difference between Scala and Java.
asked
Sep 10, 2022
in
Scala Constructs
by
Robin
scala
java
scala-vs-java
0
votes
Q: Which of the following are scala variables?
asked
Sep 11, 2022
in
Scala Constructs
by
sharadyadav1986
scala
variables
0
votes
Q: What are the types of inheritance supported by Scala?
asked
Sep 11, 2022
in
Scala Constructs
by
sharadyadav1986
scala
inheritance
0
votes
Q: What are different types of constructors used in Scala?
asked
Sep 11, 2022
in
Scala Constructs
by
sharadyadav1986
scala
constructors
...