Computer Science, asked by Aagnick16, 21 hours ago

what is data hiding in java ?​

Answers

Answered by nirvanaa757
2

Answer:

Data hiding is a technique of hiding internal object details, i.e., data members. It is an object-oriented programming technique. Data hiding ensures, or we can say guarantees to restrict the data access to class members. It maintains data integrity.

Data hiding means hiding the internal data within the class to prevent its direct access from outside the class.

If we talk about data encapsulation so, Data encapsulation hides the private methods and class data parts, whereas Data hiding only hides class data components. Both data hiding and data encapsulation are essential concepts of object-oriented programming. Encapsulation wraps up the complex data to present a simpler view to the user, whereas Data hiding restricts the data use to assure data security.

Answered by Anonymous
52

Question :- What is data hiding in java ?

Answer :- Data hiding is a software development technique specifically used in object-oriented programming (OOP) to hide internal object details (data members). Data hiding ensures exclusive data access to class members and protects object integrity by preventing unintended or intended changes.

Hope it helps you

Similar questions