更新时间:2021-06-30 19:08:34
coverpage
Title Page
Packt Upsell
Why subscribe?
PacktPub.com
Contributors
About the author
About the reviewer
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Conventions used
Get in touch
Reviews
Getting Started with Scala Programming
Introduction to Scala
A programming paradigm
Object-oriented versus functional paradigms
Scala is multi-paradigm
Scala advantages
Runs on JVM
Super smart syntax
Best of both worlds
Type is the core
Concurrency made easy
Asynchronous code
Asynchronous versus parallel versus concurrent programming
Now available for the frontend
Smart IDEs
Extensive language
Online support
Working with Scala
Java installation
SBT installation
Scala REPL
Scala IDEs
Running our first program
Summary
Building Blocks of Scala
What is underneath a Scala program?
Vals and vars
Literals
Integer literals
Floating point literals
Boolean literals
Character literals
String literals
Symbol literals
Tuple literals
Function literals
Data types
Scala's class hierarchy
Any
AnyVal and AnyRef
AnyRef
AnyVal
Unit
Boolean
Null and Nothing
Type inference
Operators in Scala
Arithmetic operators
Relational operators
Logical operators
Bitwise operators
Operator precedence
Wrapper classes
String Interpolators
The s interpolator
f Interpolator
The raw interpolator
Shaping our Scala Program
Looping
The for loop
The while Loop
The do while loop
The for expressions
The for yield expressions
Recursion
Why recursion over iteration?
Limitations of recursion
The ideal way to write recursive functions
Conditional statements
The if else conditional expression
Pattern matching
Giving Meaning to Programs with Functions
Function syntax
Nesting of functions
Calling a function
Passing a variable number of arguments
Calling a function with a default parameter value
Calling a function while passing named arguments
Evaluation strategies
Call by name