Skip to content

OOP'S Concepts iOS

Imtiaz Ahmad edited this page Dec 26, 2023 · 2 revisions

What is Abstraction?

Hiding complete implementation details from the user is called abstraction. Due to abstraction users will feel comfortable while working with the product.

What is the d/w “object based” and “object Oriented” programming language?

  1. If the programming methodology supports only encapsulation then, it is called object based programming language.
  2. If the programming methodology supports encapsulation, inheritance and polymorphism then, it is called Object Oriented Programming language. Both support code extendability.

Explain Inheritance?

  1. Inheritance is an object oriented programming concept. it allows to develop a new class that is reusable and can extend the behaviour that is defined in another class.
  2. Multiple inheritance is an object-oriented concept in which a class can inherit behavior and attributes from more than one parent class.
  3. In Swift a class can conform to multiple protocols, but inherit from only one class. Value types, such as struct and enum, can conform to multiple protocols only.

Abstract Class?

Abstract class is a class intended purely for subclassing, one must not instantiate it. Abstract class declares something and has also the implementation for that.

What is polymorphism?

  1. It enables methods to exhibit different behaviours under different instances. The task of creating a function or an operator that behaves differently in different instances is known as operator overloading which is an implementation of polymorphism.
  1. Operator overloading is the practice of adding new operators and modifying existing ones to do different things. function overloading is with different signature is called function overloading.

What is Encapsulation?

Encapsulation is an Object-Oriented Programming concept that binds together the data and functions that manipulate the data and that keep safe from outside interference and misuse.