SCALA : Knowing #TOP10 Basics, why it is so functional
1) Type of Valriables Variables are simply a storage location. Every variable is known by its name and stores some known and unknown piece of information known as value. So one can define a variable by its data type and name, a data type is responsible for allocating memory for the variable. In SCALA there are two types of variable: Mutable Variables var Variable_name: Data_type = "value" Immutable Variables val Variable_name: Data_type = "value" package com.test.util import scala.util.control.Breaks._ object BasicSample { def main(args: Array[String]) { var obj = new BasicClass(); obj.show() obj.valueDemo() obj.loopDemo() } } class BasicClass { var name = "test name" var age = 10; def show() { ...