Scala Flashcards
Flashcards companion to Introduction to Scala on DataCamp
What is Scala?
Scala is a general-purpose programming language providing support for functional programming and a strong static type system. Designed to be concise, many of Scala’s design decisions aimed to address criticisms of Java.
What language does Scala compile in?
Scala source code is intended to be compiled to Java bytecode, so that the resulting executable code runs on a Java virtual machine.
What does Scala stand for?
Scalable Language
Which companies use Scala?
Netflix, Morgan Stanley, Airbnb, Deutsche Bank
Why is Scala flexible?
Scala lets you add new types, collections and control constructs that fee llike they are built-in to the language.
Why is Scala convenient?
The Scala standard library has a set of convenient predefined types, collections and control constructs.
Who uses Scala?
Software Engineers, Data Engineers, Data Scientists, Machine Learning Engineers
Which framework is written in Scala?
Apache Spark
Whichi programming paradigms does Scala fuse?
Object-oriented and functional
What makes Scala scalable?
The fusion of object-oriented and functional paradigms.
Why is Scala an object-oriented programming language?
Every value is an object and every operation is a method call.
Why is Scala a functional programming language?
Functions are first-class values: you can pass them as argument to functions, return them from functions, store them in variables…
Operations of a program should map input values to output values rather than change data in place. In other words, functions should not have side effects.
Why use Scala?
Scala is scalable, concise, high-level, static, compatible with Java.
Which command lets you start the Scala interpreter?
scala
Which function lets you print values to standard output?
println(value)
What are the two kinds of variables Scala offers?
val and var
What distinguishes val variables?
val variables are immutable. They can’t be reassigned,
How do you declare an immutable integer variable in Scala?
val variableName: Int = 10
How do you declare an immutable string in Scala?
val variableName: String = “Alex”
What distinguishes var variables?
var variables are mutable. They can be reassigned.
How do you declare a mutable integer in Scala?
var variableName: Int = 1