Scala Basic

Running Scala
  • Discuss the usage of scala tool.
  • Explain how to compile for Scala with scalac and fsc.
  • Understand what the scala interpreter is and how to use it.
Control Structures Demonstrate comprehension of the built-in control structures
  • Write code using the basic control structures:
    • if expressions
    • while loops
    • for expressions
  • Be able to correctly handle exceptions with try expressions.
  • Display correct usage of match expressions.
  • Describe the variable scope.
  • Provide understanding of looping without break or continue.
Comments

Define comments inside a Scala code fragment, using // and /* */

Write basic ScalaDoc comments using /**

Classes and Objects This category specifically covers how to use classes and singleton objects.
  • Define and instantiate classes.
  • Declare variables and methods.
  • Demonstrate comprehension of the semicolon inference.
  • Be able to implement singleton objects.
  • Show how to create Scala applications using any singleton object with a main method.
Composition and Inheritance
  • Display the knowledge required to extend classes and how to invoke superclass constructors.
  • Show how to use abstract classes.
  • Demonstrate correct usage of override modifier when overriding methods and fields.
  • Display comprehension of polymorphism and dynamic binding.
Be able to define parametric fields. Functional Data Structures
  • Display comprehension about object's immutability.
  • Show how to use the basic data structures (available in scala package):
    • List
    • Tuple
    • Map
    • Set
  • Display correct usage of for-comprehensions and filters using them.
Functions and Closures
  • Show how to use functions through:
    • methods
    • local functions
    • first-class functions
    • function literals
  • Write code using the placeholder syntax.
  • Display comprehension of partially applied functions, aka, currying.
  • Display the knowledge required to use closures.
  • Define methods which use repeat parameters.
  • Demonstrate correct usage of tail recursion.
Traits and Self-type annotations
  • Be able to define traits.
  • Explain the distinctions between types of traits (Rich interfaces, Stackable modifications).
  • Display correct usage of self-type annotations.
Case Classes and Pattern Matching
  • Be able to define case classes.
  • Display correct usage of following kinds of patterns:
    • Wild-card patterns
    • Constant patterns
    • Variable patterns
    • Constructor patterns
    • Sequence patterns
    • Tuple patterns
    • Typed patterns
    • Show how to use pattern guards.
  • Demonstrate comprehension of the sealed classes.
  • Write code using the standard type named Option for optional values.
Implicit Conversions and Parameters
  • Write code using implicit conversions.
  • Display comprehension of rules for implicits usage:
    • Marking Rule
    • Non-Ambiguity Rule
    • One-at-a-time Rule
    • Explicits-First Rule
  • Define methods which use implicit parameters.
  • Demonstrate correct usage of views and view bounds.

你可能感兴趣的:(scala)