Back to Developer Roadmap

Method calls

src/data/roadmaps/scala/content/method-calls@w_GDO8UjtaM-XTbyQOBsQ.md

4.0903 B
Original Source

Method calls

Method calls can be made using different syntaxes and conventions. Methods can be called using the standard dot notation (e.g., obj.method(params)) or using the infix notation (e.g., obj method params). Scala also allows the omission of parentheses on methods of arity-0 (no arguments), but this syntax should only be used when the method in question has no side effects. Additionally, Scala supports named parameters, which can be used to make method calls more readable.

Visit the following resources to learn more: