Wednesday, September 20, 2017

Scala Tutorial 4 - Data Types and Variables

Strong typing is very important in functional programming

Most scripting like Ruby, Python, etc. are dynamically typed, which is supposed to be one of their advantages.

Static typing makes programming much safer.

But sometimes types declarations become a burden.

Scala’s type inferencing mechanism minimizes the number of type declarations required.

It’s not uncommon for user code to have no explicit types.

Data Types Byte : 8 bit signed value. Range from -128 to 127

Short : 16 bit signed value. Range -32768 to 32767 Int : 32 bit signed value. Range -2147483648 to 2147483647

Long : 64 bit signed value. -9223372036854775808 to 9223372036854775807

Float : 32 bit IEEE 754 single-precision float

Double : 64 bit IEEE 754 double-precision float Char : 16 bit signed Unicode character. Range from U+0000 to U+FFFF

String : A sequence of Chars

Boolean : Either the literal true or the literal false Unit: Corresponds to no value : void

Null: null or empty reference

Nothing : The subtype of every other type; includes no values Any: The supertype of any type; any object is of type

Any : Java's Object class

AnyRef: The supertype of any reference type


My Website -

My Blog -

My Facebook Page -

Google+ -

Twitter -

Pinterest -

Text Case Converter -

Epoch Timestamp Converter -

Decimal - Binary - Hexadecimal Converter -

8-bit Checksum Calculator -
IT Certification Category (English)640x480

Partner Sites

Top Online Courses From ProgrammingKnowledge

Python Course
Java Course
Bash Course
Linux Course
C Course
C++ Course
PHP Course
Android Course
C# Course
JavaFx Course
NodeJs Course
Jenkins Course
Scala Course
Bootstrap Course
MongoDB Course
QT C++ GUI Course