Explain the encapsulation principle.
Answer / Yash Kumar
The Encapsulation principle is a key concept in object-oriented programming that helps to hide the internal details or implementation of an object from the outside world. This hiding mechanism protects the object's state and behavior from being directly accessed by other objects, making the system more modular, secure, and easier to maintain. In Java, encapsulation is achieved by declaring variables as private and providing public methods (getters and setters) to access those variables.
| Is This Answer Correct ? | 0 Yes | 0 No |
How do I run a project in eclipse?
What is use of jpa?
Is eclipse a jdk?
What are the advantages of lambda functions?
Can you compile java into exe?
I am trying to create a new universal user group. Why can't i? : java security
What is jboss in java?
explain isalive() method under thread class?
What is ioexception in java?
What is javabeans api?
What are jpa repositories?
What is the difference between Enumeration and Iteration interfaces? What is the way of to retreive the objects from these interfaces ?