Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think your terminology is confused.</p> <ol> <li><p><a href="http://en.wikipedia.org/wiki/Encapsulation_(computer_science)" rel="noreferrer">Encapsulation</a> - puts related data and functionality in one place. We can get this through classes</p></li> <li><p><a href="http://en.wikipedia.org/wiki/Type_polymorphism" rel="noreferrer">Polymorphism</a> - Allows values of different data types to be handled using a uniform interface.</p></li> </ol> <p>Polymorphism can be achieved by inheriting base classes (with virtual functions) and/or by implementing interfaces.</p> <p>These techniques (and others) give us <a href="http://en.wikipedia.org/wiki/Abstraction_(computer_science)" rel="noreferrer">abstraction</a>, which really applies to any of the processes we use to break a problem up into smaller components.</p> <p><strong>EDIT</strong></p> <p>Q) You ask "Can i say,abstraction is the topmost hierarchy which is accomplished through encapsulation and polymorphism?"</p> <p>A) I can't answer that question, I don't know what you mean by "topmost" and "highest". There is no hierarchy here.</p> <p><a href="http://en.wikipedia.org/wiki/Functional_decomposition" rel="noreferrer">Functional Decomposition</a> is a form of abstraction, it can be achieved without using Object Orientation, where should it come in the hierarchy?</p> <p>The best I can do with a hierarchy is this definition (straight out of my own head, so YMMV)</p> <ol> <li>Abstraction is the practice of breaking a large problem into smaller components, so each smaller problem can be worked on in (relative) isolation.</li> <li>Polymorphism is a technique we can use to achieve abstraction. It involves identifying different types of data and behavior that can be treated in an homogeneous manner.</li> <li>An interface only declares types of behaviour, encapsulating the behaviour in a type. It provides no actual behaviour or data</li> <li>An abstract class declares types of behaviour, but may also provide behaviour and data, all encapsulated in a type.</li> <li>Therefore, an interface can be seen as providing a <em>simpler</em> or <em>purer</em> form of polymorphism than abstract classes.</li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload