Encapsulation:

Many times we might use the Base Class or Base Class library provided by third party sources. By default, These Class Members are Public in nature. It means these Class Members can be accessed directly from outside of that Class. But sometimes Base Class providers may restrict how others can access the Class members as…