One of the advantage of Object Oriented programming is ability to create hierarchy of classes. But it can also be double edged sword. It is quite possible that people may start creating the class extensions left and right without giving much though to the original thought behind the classes. How to bring in the type safety in terms of class extensions. The answer is sealed classes. In this video we explore this topic in detailed manner.
Follow me on Twitter: https://twitter.com/anilvdeshpande
00:00 Introduction to Sealed Classes
01:29 Demo - Sealed Class
03:54 Switch with Sealed Classes