-2

I am learning about OOP and I was wondering about abstraction and encapsulation. Would it be correct to say that abstraction is to chose what information to show and encapsulation is the way it is achieved? If I said this in an interview would it be a correct way to explain it?

  • You are looking at this. http://stackoverflow.com/questions/8960918/encapsulation-vs-abstraction?rq=1 – Paresh Feb 17 '17 at 20:18

1 Answers1

0

Abstraction and encapsulation are complementary concepts: abstraction focuses on the observable behavior of an object... encapsulation focuses upon the implementation that gives rise to this behavior... encapsulation is most often achieved through information hiding, which is the process of hiding all of the secrets of object that do not contribute to its essential characteristics."

Thats about as simple an answer as I can find you. source: Simple way to understand Encapsulation and Abstraction

Based on this and what I know of OOP, I would say that in an interview that would be a very basic but acceptable answer. Lots of good info on that thread. Enjoy!

Community
  • 1
  • 1
Peter Steele
  • 224
  • 3
  • 11