Summary
In this chapter, we have discussed constructors, which are the buildings blocks of OOP. We've learned how to define interfaces and various classes and the differences between inner, sealed, enum, and data classes. We've learned that all elements are public by default and all classes/interfaces are final by default, so we need to explicitly open them to allow inheritance and member overriding.
We've discussed how to define proper data models using very concise data classes combined with even more powerful properties. We know how to properly operate on data using various methods generated by the compiler and how to overload operators.
We learned how to create singletons by using object declarations and how to define objects of an anonymous ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access