Concept of Abstraction

WARDHAMAN BEDMUTHA

WARDHAMAN BEDMUTHA

@wardhaman-HBFrS6 Oct 26, 2024
Abstraction is one of the concept of Object Oriented Programming.
In simple terms Abstraction means showing only functionality to user and hiding internal details.End user will not come to know how a particular functionality is implemented .Concentrate on how to use a function rather to think how function is coded.

How to achieve Abstraction ?
Abstraction can be achieved in following two ways:
  • Abstract Class
  • Interfaces
Abstract class:
  • Abstract class is a class which is declared with keyword Abstract and this can not be instantiated.
  • Can have abstract or non abstract methods
  • Abstract class achieves 0 to 100% abstraction.
Interface :
  • Interface is a class which is declared with keyword Interface and has only abstract methods.
  • Interface is a contract /rules /blue print of a class
  • Interface achieves 100% abstraction.

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • Kaustubh Katdare

    Kaustubh Katdare

    @thebigk Jul 29, 2015

    #-Link-Snipped-# - I guess it'd be more interesting and useful if you could post some code showing the concept in action. That should help lot of fellow newbie programmers. 😀
  • Mukta Madankar

    Mukta Madankar

    @mukta-cuMxMo Jul 29, 2015

    Learn the Design Pattern - you will understand the difference well. Show us some code explaining the same, It would be helpful for us to understand the concept you explained here.
  • WARDHAMAN BEDMUTHA

    WARDHAMAN BEDMUTHA

    @wardhaman-HBFrS6 Jul 30, 2015

    Kaustubh Katdare
    #-Link-Snipped-# - I guess it'd be more interesting and useful if you could post some code showing the concept in action. That should help lot of fellow newbie programmers. 😀
    thanks a lot for your suggestion , I will try to explain with the aid of examples.