OOP in Brief

OOP in Brief


Class:

  • A blueprint or template for creating objects defines the properties and behaviors common to all objects.

Object:

  • An instance of class.

Types of contractors:

  • Default and parameterized contractors.

Encapsulation:

  • Hide and protect the data
  • By using a getter and setter.

Inheritance:

  • A class ( subclass ) can inherit properties and behaviors from another class ( superclass).

Polymorphism:

  • The ability of objects of different classes to respond to the same message.

Interface:

  • Everything is public, static, and final.
  • Functions without body.
  • Use implement
  • Can’t create objects

Abstract:

  • Can’t create objects
  • Function with and without body.
  • It can be private, public, and final
  • Use Extends.

要查看或添加评论,请登录

Eslam Elezaby的更多文章

  • Color conversion in Flutter

    Color conversion in Flutter

    ?? Excited to share a handy code snippet for color conversion in Flutter! ?? Have you ever needed to convert color…

  • Stlesswidget lifecycle.

    Stlesswidget lifecycle.

    In Flutter, StatelessWidget is a basic building block for creating user interfaces. Unlike StatefulWidget…

  • StatefulWidget lifecycle:

    StatefulWidget lifecycle:

    1- This method is called only once during the widget's lifetime. the framework calls the method of the associated to…

  • What is SOLID ?

    What is SOLID ?

    Single Responsibility: a class should have only one responsibility or job. Open/Closed: Software entities ( classes…

  • Array and Linked?List.

    Array and Linked?List.

    Array Arrays have a fixed size meaning that you need to specify the array size when you declare it. All elements in an…

社区洞察

其他会员也浏览了