- Page 1: Scala Tutorial
- Page 5 and 6: FLOATING POINT LITERALS ...........
- Page 7 and 8: Scala Strings .....................
- Page 9 and 10: CHAPTER 1 Scala Overview Scala, sho
- Page 11 and 12: CHAPTER 2 Scala Environment Setup T
- Page 13 and 14: $scala -version Scala code runner v
- Page 15 and 16: } * This will print 'Hello World' a
- Page 17 and 18: forSome If implicit import Lazy Mat
- Page 19 and 20: CHAPTER 4 Scala Data Types Scala ha
- Page 21 and 22: Characters must not necessarily be
- Page 23 and 24: Variable Type Inference: When you a
- Page 25 and 26: The access to f in class Sub is OK
- Page 27 and 28: var a = 10; var b = 20; var c = 25;
- Page 29 and 30: } } println("a && b = " + (a&&b) );
- Page 31 and 32: a >>> 15 C:/> Assignment Operators:
- Page 33 and 34: Here, operators with the highest pr
- Page 35 and 36: } If the boolean expression evaluat
- Page 37 and 38: Nested if...else Statement: It is a
- Page 39 and 40: while loop do...while loop for loop
- Page 41 and 42: Flow Diagram: Example: object Test
- Page 43 and 44: When the above code is compiled and
- Page 45 and 46: } } // for loop execution with mult
- Page 47 and 48: Flow Diagram: Example: import scala
- Page 49 and 50: Infinite Loop: A loop becomes infin
- Page 51 and 52: } } return sum A function, which do
- Page 53 and 54:
When the above code is compiled and
- Page 55 and 56:
} When the above code is compiled a
- Page 57 and 58:
} logWithDateBound("message1" ) log
- Page 59 and 60:
CHAPTER 12 Scala Strings Consider t
- Page 61 and 62:
} } var str2 = "Tod"; println("Dot
- Page 63 and 64:
23 24 25 26 27 28 29 30 31 32 33 34
- Page 65 and 66:
CHAPTER 13 Scala Arrays Scala provi
- Page 67 and 68:
C:/> Multi-Dimensional Arrays: Ther
- Page 69 and 70:
C:/> Scala Arrays Methods: Followin
- Page 71 and 72:
Scala Lists Scala Lists are quite s
- Page 73 and 74:
Creating Uniform Lists: You can use
- Page 75 and 76:
13 14 15 16 17 18 19 20 21 22 23 24
- Page 77 and 78:
var s = Set(1,3,5,7) While defining
- Page 79 and 80:
C:/> Scala Set Methods: Following a
- Page 81 and 82:
elements. 38 39 40 41 42 43 44 45 4
- Page 83 and 84:
use two maps with ++ as method colo
- Page 85 and 86:
11 12 13 14 15 16 17 18 19 20 21 22
- Page 87 and 88:
val t = new Tuple3(1, "hello", Cons
- Page 89 and 90:
The method will return Some[Person]
- Page 91 and 92:
6 7 8 9 10 11 12 13 14 def filter(p
- Page 93 and 94:
Scala Iterator Methods: Following a
- Page 95 and 96:
38 39 40 41 42 43 44 45 46 47 48 49
- Page 97 and 98:
CHAPTER 15 Scala Classes & Objects
- Page 99 and 100:
} } println ("Point y location : "
- Page 101 and 102:
CHAPTER 16 Scala Traits A trait enc
- Page 103 and 104:
CHAPTER 17 Scala Pattern Matching P
- Page 105 and 106:
} // case class, empty one. case cl
- Page 107 and 108:
} When the above code is compiled a
- Page 109 and 110:
[0-9] Match any digit; same as [012
- Page 111 and 112:
CHAPTER 19 Scala Exception Handling
- Page 113 and 114:
CHAPTER 20 Scala Extractors An extr
- Page 115 and 116:
CHAPTER 21 Scala Files I/O Scala is