- Page 2 and 3: Scala About the Tutorial Scala is a
- Page 4 and 5: Scala 4. SCALA - DATA .............
- Page 6 and 7: Scala Higher-Order Functions ......
- Page 8 and 9: Scala Regular-Expression Examples .
- Page 10 and 11: Scala Scala can Execute Java Code S
- Page 12 and 13: Scala We assume that the readers of
- Page 14 and 15: Scala Windows \>scala -version Scal
- Page 16 and 17: Scala Welcome to Scala version 2.9.
- Page 18 and 19: Scala $salary, 123abc, -salary Oper
- Page 20 and 21: Scala Newline Characters Scala is a
- Page 22 and 23: 4. SCALA - DATA Scala Scala has all
- Page 24 and 25: Scala "Hello,\nWorld!" "This string
- Page 26 and 27: 5. SCALA - VARIABLES Scala Variable
- Page 28 and 29: Scala } Save the above program in D
- Page 32 and 33: Scala } Save the above program in D
- Page 34 and 35: Scala \>scala Demo Output Point x l
- Page 36 and 37: Scala Implicit classes may not be
- Page 38 and 39: 7. SCALA - ACCESS MODIFIERS Scala T
- Page 40 and 41: Scala } Scope of Protection Access
- Page 42 and 43: 8. SCALA - OPERATORS Scala An opera
- Page 44 and 45: Scala == (Equal) 1 Checks if the va
- Page 46 and 47: Scala It is called Logical AND oper
- Page 48 and 49: Scala Ex: (A & B) will give 12, whi
- Page 50 and 51: Scala \>scala Demo Output: a & b =
- Page 52 and 53: Scala Try the following example pro
- Page 54 and 55: Scala c &= a = 0 c ^= a = 10 c |= a
- Page 56 and 57: 9. SCALA - IF ELSE STATEMENT Scala
- Page 58 and 59: Scala if(Boolean_expression){ //Exe
- Page 60 and 61: Scala }else if( x == 30 ){ println(
- Page 62 and 63: 10. SCALA - LOOP STATEMENTS Scala T
- Page 64 and 65: Scala while(condition) { Conditiona
- Page 66 and 67: Scala jumps back up to do, and the
- Page 68 and 69: Scala object Demo { } def main(args
- Page 70 and 71: Scala } } Save the above program in
- Page 72 and 73: Scala Scala's for loop allows to fi
- Page 74 and 75: Scala \>scalac Demo.scala \>scala D
- Page 76 and 77: Scala object Demo { def main(args:
- Page 78 and 79: Scala Output: Value of a: 1 Value o
- Page 80 and 81:
11. SCALA - FUNCTIONS Scala A funct
- Page 82 and 83:
Scala var sum:Int = 0 sum = a + b r
- Page 84 and 85:
Scala println("Arg value[" + i + "]
- Page 86 and 87:
Scala } Save the above program in D
- Page 88 and 89:
Scala logWithDateBound("message3" )
- Page 90 and 91:
Scala \>scala Demo Output Factorial
- Page 92 and 93:
Scala Currying Functions Currying t
- Page 94 and 95:
12. SCALA - CLOSURES Scala A closur
- Page 96 and 97:
13. SCALA - STRINGS Scala This chap
- Page 98 and 99:
Scala "My name is ".concat("Zara");
- Page 100 and 101:
Scala val name = “James” printl
- Page 102 and 103:
Scala b String Methods Following is
- Page 104 and 105:
Scala 27 28 29 30 31 32 33 34 35 36
- Page 106 and 107:
14. SCALA - ARRAYS Scala Scala prov
- Page 108 and 109:
Scala } println("Total is " + total
- Page 110 and 111:
Scala Save the above program in Dem
- Page 112 and 113:
Scala print( " " + x ) } println()
- Page 114 and 115:
15. SCALA - COLLECTIONS Scala Scala
- Page 116 and 117:
Scala val nums = Nil println( "Head
- Page 118 and 119:
Scala } Save the above program in D
- Page 120 and 121:
Scala 1 2 3 4 5 6 7 8 9 10 11 12 13
- Page 122 and 123:
Scala 34 35 36 37 38 39 40 41 42 43
- Page 124 and 125:
Scala } Save the above program in D
- Page 126 and 127:
Scala Find Common Values Insets You
- Page 128 and 129:
Scala 14 def diff(that: Set[A]): Se
- Page 130 and 131:
Scala 39 def sum: A Returns the sum
- Page 132 and 133:
Scala val nums: Map[Int, Int] = Map
- Page 134 and 135:
Scala colors.keys.foreach{ i => pri
- Page 136 and 137:
Scala 5 def iterator: Iterator[(A,
- Page 138 and 139:
Scala 30 def min: (A, B) Finds the
- Page 140 and 141:
Scala You can use Tuple to write a
- Page 142 and 143:
Scala Concatenated String: (1,hello
- Page 144 and 145:
Scala } } Save the above program in
- Page 146 and 147:
Scala 2 def isEmpty: Boolean Return
- Page 148 and 149:
Scala number of words Find Min & Ma
- Page 150 and 151:
Scala 4 def ++[B >: A](that :=> Gen
- Page 152 and 153:
Scala 28 def max: A Finds the large
- Page 154 and 155:
16. SCALA - TRAITS Scala A trait en
- Page 156 and 157:
Scala Value classes and Universal T
- Page 158 and 159:
17. SCALA - PATTERN MATCHING Scala
- Page 160 and 161:
Scala val charlie = new Person("Cha
- Page 162 and 163:
18. SCALA - REGULAR EXPRESSIONNS Sc
- Page 164 and 165:
Scala } Save the above program in D
- Page 166 and 167:
Scala \\n Back-reference to capture
- Page 168 and 169:
Scala val pattern = new Regex("abl[
- Page 170 and 171:
Scala } } } } Save the above progra
- Page 172 and 173:
20. SCALA - EXTRACTORS Scala An ext
- Page 174 and 175:
Scala def main(args: Array[String])
- Page 176 and 177:
Scala print("Please enter your inpu