31.1k views
0 votes
Related to Scala Constuct

1 Which of the following are the key concepts of Functional Programming a. Immutability b. Pure functions c. Inheritance d. Referential Transparency .



2 Can the following pseudo function be considered a pure function ? function getMeTimeAdded(arg Integer) = currentTime + Integer



3 You can modify an immutable object once created (Yes/No)


4 Scala is a pure functional programming language (True/False)


5 Functional programming language cannot be an object oriented language too (True/False)



6 For the given statement,


val s = List(1,2,3)


What would be the type of s?


7 Is this a valid expression val f: Int = (x: Int) => x + 1



8 What is the preferred qualifier for defining a variable in Scala.


9 What is the default class List is imported from ?


10 Functions are first class objects in function

User Jon Reeves
by
5.0k points

2 Answers

3 votes

1 b

...............................

User Chris Green
by
4.4k points
4 votes

Answer:

1. B (pure functions)

2. No, It is an inheritance.

3. No, immutable objects are objects which cannot be changed.

4. False, Scala programming is a pure object oriented programming.

5. True, functional programming is a layer above object oriented programming.

6. The type of s would Scala

7. Yes, the expression is valid

8. The best qualifier is myvar(syntax variable).

9. It is imported from Scala

10. Yes, a function is said to be first class when it is treated like other variables.

User ShowFocus
by
5.2k points