Question
Which Scala keyword defines a method?
Select an option. Your answer will be checked instantly.
Correct Answer: B. def
Explanation:
Methods are introduced with def and can accept parameter lists.
Their return type may be inferred or written explicitly.
Leave a Reply