What is Abstraction and Encapsulation

Abstraction & Encapsulation are two important OOPs concept. Most of the IT developers are confused in Abstraction & Encapsulation. Here’s a simple & short description about these two, Which will depict clear picture.

Abstraction : Abstraction is used to hide implementation detail of methods ( behavior of a class). It can be achieved by using methods, abstract class or interface. (when we expose any API to client. Client can only see or know the functionality of an API rather than actual logic).

Encapsulation: Encapsulation is used to hide data/ information. It can be achieved by using classes, access modifiers (Public, Private, Protected & Default ). Client can’t see the properties of class until the properties are exposed through the method.

Here’s an example of Employee class with three properties.

Employee ID
Employee Designation
Employee Salary

Client even can’t see, how employee salary is being implemented. It means, abstraction is achieved.

In above example, Client can’t see properties detail of employee class. It means, encapsulation is achieved.

Note: Feel free to comment, If you have any query or concern.

9 thoughts on “What is Abstraction and Encapsulation

  1. Invite You to Review Our Product

    I am Trish from the American Beauty Association.

    I’m reaching out to you because we are looking for beauty enthusiasts like you to test our makeup brush.

    Go to test the Mieoko Flat Top Brush

    * Perfect for medium to heavy coverage that doesn’t look caked on
    * Does not soak up excessive amounts of product.
    * 22,000 mink soft bristles for flawless powder or liquid makeup application
    * Does Not Shed!

    Thank you for your time,


  2. Welcome to your invitation to make it worse real money online..I have
    spent too much effort looking legitimate ways drugs good money online.
    I have found two amazing opportunities, generate a decent income working their home.

    Another way to verify that you just are by using a good company is to
    check while BBB world wide web. It is exact
    same holds true Better Business Bureau service that must be used offline.
    There you will get information on the company discover what connected with a story they
    have and their background and make contact
    with information. You can also find complaints filed by past customers and determine whether the company
    responded all of them accordingly.

    Others begin with an appetizer e-book or report over the keyword title and
    watch how it really is downloaded. If there is don’t want it to
    be for free (viral marketing), they won’t buy proper photography experience .
    product either.

    How quit apply the easy internet marketing? Entrepreneurs produce their products on net.
    Produce their own website. Let readers opt-in and once
    did, they give email messages offering buyers
    the products they are available. But of course, you must be
    smart in sending your has. Do not frequently send that which you are selling.
    Provide also free information that you can used by them.

    You are now able to throw each of your fears and worries gone.

    Here you will see out exactly what to search out in a chance
    to be certain that these not be taken advantage coming from all.
    If you follow these simple guidelines when researching an at home
    money making opportunity, you will be able remain in away from
    all the same and begin to make win real money online no deposit fairly quickly.

    AshMax made and founded by Ash Mufareh, ideal Global Domains International (GDI)
    marketer across the nation. If you haven’t heard for the GDI opportunity
    before, they’re one of your oldest as well as most well-known multi-level marketing/networking marketing (MLM)
    companies on the internet, having started last 1999.

    I imagine that the easiest strategy to make money online in order to use start weblog.
    It doesn’t cost anything and try to blog and you can set up ads through Google’s Ad sense.
    You can also use the affiliate programs that Amazon has available and
    lot quite discover those. You’d be surprised at how many different things marketing from your blog.

    Although there isn’t a sure ( blank ) to success live on the internet there
    absolutely many in order to fail. During around this is to research,
    plan, and learn. Essential process, a formula, shed extra pounds succeed ultimately
    online business world. Can you really cash working via internet?

    Absolutely. If you take time upon you to ultimately
    see what it really takes staying successful, in order to
    definitely can generate income online.

  3. Business Cooperation – Purchase Your Web site Traffic

    How to earn more money with your web site ?

    Media Advertising Platform runs the #2 largest contextual ads program globally and can generate a great deal of revenue for your website.

    You will get high converting ad design options, the ad units look like navigation menus, so it will result in a higher Click Through Rate.

    You’re also permitted to place ads in sticky or fixed sidebar zones.This is a HUGE benefit. You cannot place Adsense ads in a floating/fixed/sticky sidebar zone.

    Go here to sign up (bonus 10% revenue for first 3 months) :

    {Thank you|Thanks|Thanks a lot,
    Valery Wakenight

    IMPORTANT: Remember to ask your customer service representative to help you {optimize|improve} ads,their ad design will dramatically increased {revenue|income|earnings}!!

    *Unsubscribe*: Reply “NO”

  4. Invite Bloggers and Webmasters to Join Our Paid Survey

    I’m Rebeca from PerfectMediaLab – a great survey website.

    We are running a campaign to give bloggers a chance to earn extra cash.

    You can try it by investing a Small $1 (60-Day Money Back Guarantee), usually $27 per month.

    Start now:


    Rebeca Ruzicka

    Unsubscribe: Reply “No”

Leave a Reply to Rebeca Ruzicka Cancel reply

Your email address will not be published. Required fields are marked *