adspace
Answer Posted / 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 |
Post New Answer View All Answers
Can we extract main method from another class?
What is the first argument of the string array in main method?
what is reflection api? How are they implemented?
Are jvm’s platform independent?
What if I write static public void instead of public static void?
What do you understand by casting in java language? What are the types of casting?
What is the java api?
What is the resourcebundle class?
What is the locale class?
How does java handle integer overflows and underflows?