Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8997327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:52:29+00:00 2026-06-15T23:52:29+00:00

What are the differences between information hiding and encapsulation ? I have read that

  • 0

What are the differences between information hiding and encapsulation?

I have read that encapsulation means bundling data and the procedures that should operate on them together. If that is so, does the following class achieve encapsulation?

class IsThisEncapsulation {
    public int age;

    public int getAge() {
        return this.age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}

Now would declaring the data attribute age private achieve information hiding?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T23:52:30+00:00Added an answer on June 15, 2026 at 11:52 pm

    Well I know that making fields private and then making setter and getter of the fields is encapsulation. However, does encapsulation mean just this?

    —> Encapsulation is an OOP concept where object state(class fields) and it’s behaviour(methods) is wrapped together. Java provides encapsulation using class.

    Information Hiding:

    –> mechanism for restricting access to some of the object’s components. Your above example is the case of Information Hiding if you make age private.


    Initially, Information/Data Hiding was considered the part of Encapsulation, and the definitions of Encapsulation would be as:

    • A language mechanism for restricting access to some of the object’s components.
    • A language construct that facilitates the bundling of data with the methods (or other functions) operating on that data.

    the second definition is motivated by the fact that in many OOP languages hiding of components is not automatic or can be overridden; thus, information hiding is defined as a separate notion by those who prefer the second definition.

    Reference: wikipage

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like information on algorithms that can help identify commonality and differences between
The differences between StringBuilder and StringBuffer in Java are well documented and have been
What are the differences between preg_replace() and preg_filter() ? In which situations should I
What are the main differences between these WPF controls? And when I should use
Where can I find information on the differences between calling on a column within
I read somewhere that I should stop using <%= … %> to render and
I understand the differences between them (at least in C#). I know the effects
I have a question about entity creations that is specific to a student information
Can you tell me what is the difference between abstraction and information hiding in
I have a program that has a list of information that when tapped it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.