Java Interview 05 - Encapsulation Vs Abstraction

preview_player
Показать описание
This video explains the difference between encapsulation and abstraction.
If you like the video please support me by donating through paypal.

Рекомендации по теме
Комментарии
Автор

Encapsulation aims at hiding data while abstraction aims at hiding the implementation detail. Well said !!

Odim
Автор

I have been watching videos to understand abstraction. No others were explanatory like yours. Thank you so much

ashyrhudayberdiyev
Автор

one of the best video on encapsulation vs abstraction

jaspreetsingh-nhkn
Автор

What you explained in 6 minutes took my prof 2 weeks 🙂

ahmedboukhousse
Автор

Thank you miss. Your interpretation of abstraction, encapsulation is very useful and crystal clear

kiranmb
Автор

Your lectures are very useful! Thank you so much indeed! Please keep doing like these videos

MrAbbasalrassam
Автор

This 6 minutes video allowed me to skip a 1.5-hour lecture class.

sukhmitbhullar
Автор

you explanation better more than my instructor :) thanks alot <3

abdullahalkatheri
Автор

You are a great teacher. good Time duration.

zoom
Автор

Really short with exact meaning, I salute your good effort. Congrats mam good work keep it up....

balajid
Автор

thanks!! great explanation. I appreciate your work

fireflies
Автор

I did not get the advantage of Encapsulation. You said that we can not set the value of variable since it is private but we can set the value with setter method, then where is the advantage?

ILuvBilli
Автор

Can we do abstraction without abstract class and interface?because in the eg of encapsulation and abstraction u haven't used any abstract keyword

anujtrikha
Автор

Concise explanation, really helped me get to grips with this subject, thank you for your time in putting this together!

kAht
Автор

I am really not getting your abstraction example because to call a method of class we need to create a object of that class that's what done there so it means we will achieve abstraction every time when we call method by creating object?

blackknight
Автор

Thank u mam really well explained.
I have given the same answer during interview
But he was not satisfied
Cross question bahut kiya

rebelsk
Автор

Whats the difference between Code and data ?

proocol
Автор

Encapsulation: What is included
Abstraction: What is not included
maybe?

barrydevine
Автор

Just a correction and modification of some concepts

Abstraction is not that concept of showing or providing only the important things and hiding all unnecessary or complex details from the user (the programmer), as everyone thinks

You kindly explained that Abstraction is to provide only what the user can get, in short, to provide only the Important points in the classes that will be instanciated using an Object, and this is unfortunately wrong....

And if it was actually in this sense, the name would have been Only-Important-members or Hidding Data and so on...

In short, your concept is part of the definition of Encapsulation and not Abstraction, and it is very close to the concept of inheritance more than Encapsulation

Linguistically:

Abstraction means intangible or imaginary or virtual or the opposite of Concrete which means tangible, real or active

Programmatically:

It specifically means the Class and the Interface (interface is not available in all programming languages). The important thing is the Class in itself.

And any Class in OOP is considered as a Template, Model, or Map of something in Reality. That thing may be real or imaginary, and as it may be tangible or intangible, it does not matter the Projection and how .... but it matters The Classes that will Ultimately Express an Entity, Component, or Object that we will deal with later....

So Abstraction in OOP will be like that:

Modeling the Real World. and No more than this Definition ..


There are also inactive, intangible, or Abstract Classes that we call them Class Model, and they are somewhat similar to the Interface.

This type has a directive of type Abstract and it does not accept instanciate with Objects, that is, it has no Objects to represent it (No Instances).

And her task is Only to make a Model or Template for her children's that inherited from and finally can share members from base Abstract Classe.

And this technique is also within the definition of the corner Abstraction

And my concept here is in modeling and not in the role of the abstract class (because its role in terms of providing only what the sons classes can share as members and this is a part from the corner of inheritance)

finally :

Abstract classes is an Abstract Model for a Concrete classes Where this concrete will be a Models for some objects in our Real World...

Interfaces are also a Model or Abstract that Classes use them in-order to benefit from those members in that Interface..

So, Abstraction OOP is only about these three things in C Sharp, Java and Delphi and maybe C++ builder(because all of them have Interface as far as I know now)

As for the definition that you explained in the video, it is related to Encapsulation and Inheritance rules and not Abstraction at All ..

Abstraction is the first Step Rule of OOP Pillars wich is the Classes and Interfaces ...
Abstraction is not more than a Modelling ...

And thank you for your understanding ...

MBen_Delphi
Автор

Still didn't understand the difference

EDMVibes