What is abstraction? How does it differ from encapsulation



What is abstraction? How does it differ from encapsulation..

Answer / Rahul Saxena

Abstraction is a mechanism to hide the internal details and complexity of an object, showing only essential features or properties. It helps to reduce the complexity of dealing with complex objects. Encapsulation is the practice of wrapping the data (variables) and code acting on the data (methods) together as a single unit. While encapsulation is about restricting access to the object's variables, abstraction is about defining the interface of an object without revealing its implementation details.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More OOAD Interview Questions

What interface must an object implement before it can be written to a stream as an object?

1 Answers  


What is the base type from which all structs inherit directly?

1 Answers  


What is static polymorphism?

1 Answers  


Is it possible to create partial structs, interfaces and methods?

1 Answers  


Giving reasons explain two external responsibilities of a project manager.

2 Answers  


What is bootstrap, extension and system class loader?

1 Answers  


Can you think of some nice examples where *multiple* actors are associated with a use case ?

2 Answers   Protech,


What is the use if instanceof keyword?

1 Answers  


What is @functionalinterface?

1 Answers  


What is the default access specifier in a class definition?

1 Answers  


Why we use oops concepts? What is its advantage?

1 Answers  


Explain persistence?

1 Answers  


Categories