Home » » Scala Tutorial Four - Information Types Together With Variables

Scala Tutorial Four - Information Types Together With Variables



Strong typing is really of import inwards functional programming

Most scripting similar Ruby, Python, etc. are dynamically typed, which is supposed to locomote i of their advantages.

Static typing makes programming much safer.

But sometimes types declarations teach a burden.

Scala’s type inferencing machinery minimizes the publish of type declarations required.

It’s non uncommon for user code to convey no explicit types.



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

Short : xvi fleck signed value. Range -32768 to 32767 Int : 32 fleck signed value. Range -2147483648 to 2147483647

Long : 64 fleck signed value. -9223372036854775808 to 9223372036854775807

Float : 32 fleck IEEE 754 single-precision float

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

String : Influenza A virus subtype H5N1 sequence of Chars

Boolean : Either the literal truthful or the literal fake Unit: Corresponds to no value : void

Null: zilch or empty reference

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

Any : Java's Object class

AnyRef: The supertype of whatsoever reference type





-------------------------Follow-------------------

My Website - http://www.codebind.com

My Blog - https://goo.gl/Nd2pFn

My Facebook Page - https://goo.gl/eLp2cQ

Google+ - https://goo.gl/lvC5FX

Twitter - https://twitter.com/ProgrammingKnow

Pinterest - https://goo.gl/kCInUp

Text Case Converter - https://goo.gl/pVpcwL

Epoch Timestamp Converter - https://goo.gl/Zedjo5

Decimal - Binary - Hexadecimal Converter - https://goo.gl/rkX3JE

8-bit Checksum Calculator - https://goo.gl/inxvIT

0 comments:

Post a Comment

Search

Blog Archive