1.

What Is The Main Design Decision About Two Separate Keywords: Class And Object In Scala? How Do We Define Instance Members And Static Members In Scala?

Answer»

In Scala, we USE class keyword to define instance members and object keyword to define static members. Scala does not have static keyword, but still we can define them by USING object keyword.

The MAIN design decision about this is that the clear separation between instance and static members. Loosely COUPLING between them. And other major reason is to avoid static keyword so that Scala will become a Pure-OOP Language.

In Scala, we use class keyword to define instance members and object keyword to define static members. Scala does not have static keyword, but still we can define them by using object keyword.

The main design decision about this is that the clear separation between instance and static members. Loosely coupling between them. And other major reason is to avoid static keyword so that Scala will become a Pure-OOP Language.



Discussion

No Comment Found