Saturday 8 August 2020

Scala Tutorial


      Introduction to Scala
      Installing Scala
      Scala Hello World in Intellij IDEA
      Hello World using scalac and scala
      Eclipse: Hello World using worksheet
      Mutable and Immutable variables
      semicolons are optional
      Data types
      Working with Strings
      Define a string
      Concatenate strings
      Triple quotes to handle multi line strings
      String interpolations
      Formatting strings: printf notation
      Unified Type System
      Type Operators
      Expression and statements
      Expression Blocks
      Nested Expression Blocks
      if/else expression blocks
      What if condition returns value of some type and else return some other type
      match expression
      How to handle Scala.MatchError
      Match expression: Test the type of a variable
      for loop
      for loop as expression
      for loop with if condition
      Nested for loops
      for loop works for any collection
      while loop
      do-while loop
      Lambda Expressions
      Functions
      Named Parameters
      Default values to arguments
      Varargs: Variable number of arguments
      Arrays
      Traverse an array
      ArrayBuffer
      Maps
      Iterate over a map
      Convert a map of (key, value) to map of (value, key)
      Tuple
      Classes
      How to define a constructor?
      Infix notation of methods
      How to define static methods and singletons
      Companion Object
      Statements in the class body gets executed while initializing an instance
      Hello World project in Eclipse
      Packages
      Inheritance
      Traits
      Emptiness
      Operators are methods
      functions
      Currying
      Create java.lang.Object instance
      to method
      Working with BigInt
      Method without parameters do not require () while calling
      apply method can be called without name
      Get square root of numbers from 1 to 10
      Get permutations of a string
      Convert integer to character
      Convert character to integer
Previous                                                    Next                                                    Home

No comments:

Post a Comment