1. For each statement below, determine if it is True or False and discuss why. (a) Scala is a dynamically typed programm
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
1. For each statement below, determine if it is True or False and discuss why. (a) Scala is a dynamically typed programm
1. For each statement below, determine if it is True or False and discuss why. (a) Scala is a dynamically typed programming language (b) Classes in Scala are declared using a syntax close to Java's syntax. However, classes in Scala can have parameters. (c) It is NOT possible to override methods inherited from a super-class in Scala (d) In Scala, when a class inherits from a trait, it implements that trait's interface and inherits all the code contained in the trait. (e) In Scala, the abstract modifier means that the class may have ab- stract members that do not have an implementation. As a result, you cannot instantiate an abstract class. (f) In Scala, a member of a superclass is not inherited if a member with the same name and parameters is already implemented in the subclass. 2. Which is output of the following lines of code in Scala object example1 { class ChecksumAccumulator { var sum = 0 } def main(args: Array [String]) : Unit={ val calc = new ChecksumAccumulator println("calc.sum (" + calc.sum + "]") } } :
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!