Search Your Question

OOPS Concept in iOS

Ans :  OOPS Concepts are mostly same in all language. Their working are same but conditions are different.

1.      Inheritance : It allows a class to be defined that has a certain set of characteristics(methods and variables) and then other classes to be created which are derived from that class. The derived class inherits all of the features of the parent class and typically then adds some features of its own.

2.      Encapsulation : That binds data and functions together and keeps both safe from outside interference and misuse. Data encapsulation’s benefit of data hiding.

Data encapsulation is a mechanism of bundling the data and the functions that use them.

Data abstraction is a mechanism of exposing only the interface and hiding the implementation details from the user.


3. Polymorphism : Difference process depends on type. The method to be invoked is determined at runtime based on the type of the object. It is like override and overload.

Override : Different class, same method name with signature. It is also called runtime or dynamic polymorphism.

Overload : Same class, method name same with Different parameter. It is also called compile-time or static polymorphism. 


No comments:

Post a Comment

Thanks