Topics under OOPs (Object oriented programming language)
- Data hiding
- Tightly Encapsulated class
- Is-A relationship/Has-A relationship
- Method signature
Class and Object
Consider to build an building we first need a plan on paper. This plan can be called as “Class”. And the actual build buildings are can be called as Objects. So we can say Class is an template of an object and Object is an template of a class.
Data hiding is a process of hiding a own data from other users. This Data hiding can be done by Private access specifier in java. Make data member/variables as private.
Eg: You can access only your account data details in bank. You can’t access other users account data.
Abstraction is hiding internal implementation and just highlight thing those we are offering. Abstraction can be done by Abstract classes.
Advantage: Security, Maintenance of application.
Binding data members and corresponding method(behavior) into single unit.
Disadvantage: Slow down application
Tightly Encapsulated class
A is said to be Tightly Encapsulated class if each and every variable is declared as Private whether geter() and seter() method set as Public or not, no need to check.
Is-A relationship/Has-A relationship
Is-A relationship is also known as Inheritance. This can be implemented by “extend” keyword.
Advantage: Re-usability of a code