Scala visibility

Visibility is about what aclassor anobjectexpose to the rest of the world.

Let's review the different kind of visibility:

  • public: In scala, thepublickeyword does not exist, this is the default behavior. If nothing is specified, the member of this context will be available for all to call.
  • private: This will make the member not visible to the rest of the world (There is an exception aboutcompanion object, we are going to learn about it in a future SKB).
  • protected: This was not illustrated in this exercise. It is related toobject oriented programmingand more specifically aboutinheritance. We are going to learn more about it in a later SKB.

Reveal more information and clues
Load Exercise