What is a mechanism of wrapping the data and code acting on the data together as a single unit?
File name : EncapTest.java / Show public int getAge() { public String getName() { public String getIdNum() { public void setAge( int newAge) { public void setName(String newName) { public void setIdNum( String newId) {
Please give valid points on how these two OOPs concepts are different from each other
loadAnswer Other Related Discussions
Didn't get the answer. What is called the wrapping code and data together into a single unit?Encapsulation is defined as wrapping up of data and information under a single unit.
What is the mechanism of wrapping data and behavior ie variables and methods together as a single object?Encapsulation in Java is a mechanism to wrap up variables(data) and methods(code) together as a single unit. It is the process of hiding information details and protecting data and behavior of the object. It is one of the four important OOP concepts.
What combines data and methods into a single processing element?A class combines data and function into a single unit. The method of hiding details of a class is called abstraction.
What is data hiding mechanism?It is a mechanism used to hide the data implementation details while exposing the data abstraction to the outside world. The process of hiding information behind a well-defined interface is known as encapsulation. Encapsulation is a powerful concept of object-oriented programming.
|