what is encapsulation in java? Explain



what is encapsulation in java? Explain..

Answer / Laxmi

Encapsulation in Java is the mechanism of hiding internal implementation details (attributes or methods) of an object and exposing only the necessary public interfaces. It helps to prevent data from being accessed directly by other classes, enhances code reusability, improves modularity, and provides a strong access control mechanism.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

How do you do absolute value in java?

1 Answers  


How does system arraycopy work in java?

1 Answers  


Explain Connection Pooling?

3 Answers  


What are the differences between string, stringbuffer and stringbuilder?

1 Answers  


What is the purpose of finalization in java programming?

1 Answers  


How are variables stored?

1 Answers  


Why do we use return statement?

1 Answers  


What is the difference between Access Modifier and Access specifier?

1 Answers  


What is meant by nested loop?

1 Answers  


What do you mean by scope of variable?

1 Answers  


What do the thread?class methods run() and start() do?

1 Answers  


Why singleton pattern is better than creating singleton class with static instance?

1 Answers  


Categories