Data Abstraction & Encapsulation:Abstraction and encapsulation are important features of any object-oriented programming language.Abstraction involves extracting only the relevant information.Encapsulation involves packaging one or more components together.Encapsulation literally means ‘to enclose in or as if in a capsule’.Encapsulation is defined as the process of enclosing one or more items within a physical or logical package.It involves preventing access to nonessential details.
Access specifier:-An access specifier defines the scope of a class member.A class member refers to the variables and functions in a class.A program can have one or more classes.You may want some members of a class to be accessible to other classes.But, you may not want some other members of the class to be accessible outside the class.public private protected internalprotected internal
Access specifier:-An access specifier defines the scope of a class member.A class member refers to the variables and functions in a class.A program can have one or more classes.You may want some members of a class to be accessible to other classes.But, you may not want some other members of the class to be accessible outside the class.public private protected internalprotected internal
Abstraction is used to hide unnecessary details and show functionality
ReplyDeleteEncapsulation provide access of data in controlled manner and bind data togather