Is hiding implementation detail Encapsulation or Abstraction

0 votes

I have seen some people defining abstraction as :

Abstraction is hiding the implementation details by providing a layer over the basic functionality.

Is it not part of encapsulation to hide implementation details from the user of the object?

For example, if an animal class has a function eat() and if you provide this interface to the user then is it encapsulation or abstraction? I found this answer :

abstraction = the object externally; encapsulation (achieved through information hiding) = the object internally.

So what is the conclusion that object interface exposure is abstraction is encapsulation? Can someone brief me on this?

May 6, 2022 in Java by narikkadan
• 63,600 points
3,134 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Java

0 votes
3 answers

How to check whether a string is empty or not? Is there a function for this?

str != null && str.length() != 0 alternatively str ...READ MORE

answered Sep 11, 2018 in Java by Sushmita
• 6,920 points
1,431 views
+9 votes
16 answers

Unable to resolve this error: "javac is not recognized as an internal or external command"

Check your javac path on Windows using Windows Explorer C:\Program Files\Java\jdk1.7.0_02\bin and ...READ MORE

answered May 23, 2018 in Java by Rishabh
• 3,620 points
463,851 views
0 votes
2 answers

Scanner is skipping nextLine() after using next() or nextFoo()?

use input.nextLine(); after your nextInt() function for example:- input.nextInt(); ...READ MORE

answered May 11, 2019 in Java by Sourav Dangi
17,965 views
0 votes
1 answer

While using next() or nextfoo() , the upcoming nextLine() is skipped by scanner

That's because the Scanner.nextInt method does not ...READ MORE

answered Jun 6, 2018 in Java by mitto
• 160 points
3,061 views
0 votes
1 answer

Is Java “pass-by-reference” or “pass-by-value”?

Think of reference parameters as being aliases ...READ MORE

answered Jun 8, 2018 in Java by Rishabh
• 3,620 points
1,350 views
+1 vote
2 answers

Is there a code to find 64-bit JVM or 32-bit JVM (from within a program)?

Do I need to understand the difference ...READ MORE

answered Jun 11, 2019 in Java by Jim
• 810 points
2,289 views
0 votes
1 answer

C++ override inherited methods

Child::init is now concealing Father::init and not overriding it.  In order to receive dynamic dispatch, your init member function must be virtual: virtual void init () { ...READ MORE

answered Jun 20, 2022 in C++ by Damon
• 4,960 points
576 views
0 votes
1 answer

What are the prerequisites to learn Hadoop in java perspective?

In my day job, I've just spent ...READ MORE

answered Oct 11, 2018 in Big Data Hadoop by Frankie
• 9,830 points
778 views
0 votes
1 answer

How is inheritance in C++ different than that in Java?

The purpose of inheritance is same for ...READ MORE

answered Feb 6, 2019 in Java by Priyaj
• 58,020 points
977 views
0 votes
1 answer

What is the reason for no ConcurrentHashSet against ConcurrentHashMap?

Hello, There's no built in type for ConcurrentHashSet because you ...READ MORE

answered Apr 8, 2020 in Java by Niroj
• 82,840 points
1,474 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP