Scala Learning Series

Why Scala doesn’t have “static”?

Scala Programming

Photo by Denys Argyriou on Unsplash.

This is the design decision made by the Scala team. The main reason for this decision is to make Scala a pure object-oriented language, as static doesn’t belong to an object.

The “static” keyword means that we can access those class members without creating an object or using an object. This is completely against OOP principles. If a language supports the “static” keyword, then that language is not a pure object-oriented language.

--

--

Senthil Nayagan
Senthil Nayagan

Written by Senthil Nayagan

I am a Data Engineer by profession, a Rustacean by interest, and an avid Content Creator.

No responses yet