1.

Why Scala Does Not Have “static” Keyword? What Is The Main Reason For This Decision?

Answer»

As we know, Scala does NOT have “static” KEYWORD at all. This is the design DECISION done by Scala Team.

The main reason to take this decision is to make Scala as a Pure OBJECT-Oriented Language. “static” keyword MEANS that we can access that class members without creating an object or without using an object. This is completely against with OOP principles.

If a Language supports “static” keyword, then that Language is not a Pure Object-Oriented Language. For instance, as Java supports “static” keyword, it is NOT a Pure Object-Oriented Language. But Scala is a Pure Object-Oriented Language.

As we know, Scala does NOT have “static” keyword at all. This is the design decision done by Scala Team.

The main reason to take this decision is to make Scala as a Pure Object-Oriented Language. “static” keyword means that we can access that class members without creating an object or without using an object. This is completely against with OOP principles.

If a Language supports “static” keyword, then that Language is not a Pure Object-Oriented Language. For instance, as Java supports “static” keyword, it is NOT a Pure Object-Oriented Language. But Scala is a Pure Object-Oriented Language.



Discussion

No Comment Found