


We put the private / protected keywords before data to protect it from the outside world.

We also protect the data by using access specifiers. Clients of the object only see these behaviors and by only these behaviors clients can modify the data. We hide the state of an object by using properties and methods. Only defined behaviors in a class can modify the data. In Encapsulation, we bind the data and behaviors in one object. That means any function in the program can modify the data. In non object oriented languages, data and behaviors are not tied together. We put these method signatures and properties into interface or abstract class. We take a implemented class and took only those method signatures and properties which are required by the class client. In OOPS we achieve the abstraction by separating the implementation from interface. Inversion of Control and dependency injections are some techniques for getting loose coupling in modules.Ībstraction is a technique of taking something specific and making it less specific. Two modules are highly dependent on each other if you have changed in one module and for supporting that change every time you have to change in dependent module.
#Basics of oops interview questions software
Coupling refers to level of dependency between two software modules. OOPS Modules are dependent on each other. Cohesion shows how much a module responsibilities are strongly related. Each module has certain responsibilities.
