Why Scala does NOT have 'static' keyword? What is the main reason for this decision?
Answer / Kunal Sinha
The 'static' keyword in Java is used to define class variables and methods that belong to the class level, not an instance. Scala opted to avoid using this keyword because it encourages functional programming and discourages global state.
| Is This Answer Correct ? | 0 Yes | 0 No |
Explain the main difference between List and Stream in Scala Collection API? How do we prove that difference? When do we choose Stream?
What is try catch in scala?
What is Extractor in Scala? What is the difference between Constructor and Extractor in Scala? What is the use of Extractor in Scala?
What is ‘scala trait’ in scala?
Explain operator and Explain types of operators in scala?
How does yield work in scala?
What is the use of 'object' keyword in Scala? How to create Singleton objects in Scala?
What is Scala?
What are the Scala variables?
How to create arrays in scala?
What do you mean by a case class in scala?
Does Scala support all Functional Programming concepts? Does Java 8 support all Functional Programming concepts?