09.10.2014 Views

Download Scala Tutorial (PDF Version) - Tutorials Point

Download Scala Tutorial (PDF Version) - Tutorials Point

Download Scala Tutorial (PDF Version) - Tutorials Point

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

FLOATING POINT LITERALS ................................................................ 19<br />

BOOLEAN LITERALS............................................................................. 19<br />

SYMBOL LITERALS ............................................................................... 19<br />

CHARACTER LITERALS........................................................................ 19<br />

STRING LITERALS ................................................................................ 19<br />

MULTI-LINE STRINGS ........................................................................... 19<br />

THE NULL VALUE .................................................................................. 20<br />

ESCAPE SEQUENCES: ......................................................................... 20<br />

<strong>Scala</strong> Variables ...................................................................... 21<br />

Variable Declaration ................................................................................ 21<br />

Variable Data Types: ............................................................................... 21<br />

Variable Type Inference: ......................................................................... 22<br />

Multiple assignments: .............................................................................. 22<br />

Variable Types: ........................................................................................ 22<br />

FIELDS: ................................................................................................... 22<br />

METHOD PARAMETERS: ...................................................................... 22<br />

LOCAL VARIABLES: ............................................................................... 22<br />

<strong>Scala</strong> Access Modifiers .......................................................... 23<br />

Private members: .................................................................................... 23<br />

Protected members: ................................................................................ 23<br />

Public members: ...................................................................................... 24<br />

Scope of protection: ................................................................................. 24<br />

<strong>Scala</strong> Operators ..................................................................... 25<br />

Arithmetic Operators: ............................................................................... 25<br />

Example: ................................................................................................. 25<br />

Relational Operators: ............................................................................... 26<br />

Example: ................................................................................................. 27<br />

Logical Operators: ................................................................................... 27<br />

Example: ................................................................................................. 27<br />

Bitwise Operators: ................................................................................... 28<br />

Example .................................................................................................. 29<br />

Assignment Operators: ............................................................................ 30<br />

Example: ................................................................................................. 30<br />

Operator Precedence in <strong>Scala</strong>: ................................................................ 31<br />

<strong>Scala</strong> IF…ELSE Statements .................................................. 33<br />

The if Statement: ..................................................................................... 33<br />

SYNTAX: ................................................................................................. 33<br />

EXAMPLE:............................................................................................... 34<br />

The if...else Statement: ............................................................................ 34<br />

TUTORIALS POINT<br />

Simply Easy Learning

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!