Objects and Companions in Scala | Rock the JVM

preview_player
Показать описание


This is a beginner-level video. If you're learning Scala and its distinguishing feature, this video is for you.

In this video we'll explore Scala objects, which implement the singleton pattern in a single line of code. We look at how Scala classes and objects can work together to form companions, and what's the best practice for structuring your code in between classes and their companion objects in Scala. We also discuss some nuance about the type difference between classes and objects.

Follow Rock the JVM on:

-------------------------------------------------------------------------
-------------------------------------------------------------------------
Рекомендации по теме
Комментарии
Автор

This video was completely useful, thank you so much!

FoxRed
Автор

Dan you are awesome and you should know about that and wanna say thank you very much for great videos!!!

ZoYaBoBo
Автор

Really concise explanation ! The analogy with "static" keyword in java was more than enough to understand what's happening. Nice content !

RedionXhepa
Автор

When you say a class and companion object can access each others private members does that mean the companion object can access the class's private members?

theyreMineralsMarie
visit shbcf.ru