whst is encapsulation?when u encpsulate actually while
devoloping code?
Answer Posted / jag bhushan
Encapsulation means wrapping of data and the accessing
methods in one unit and hiding the data from outside world.
the data can be accessed only by using getter/setter method
so that no one can set a wrong value for a vriable. like
weight can not be less than zero. so if anyone want to set
the weight, it have to set only be using getter/setter.
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are the benefits of immutable objects?
How to sort numbers in java without array?
What is an i/o filter?
What is a blocking method in Java?
What is finally in Java?
What is a file pointer?
How can you add and remove nodes in jtree?
Can we sort list in java?
Write a function to print Fibonacci series and Tribonacci series?
What is difference between string and new string?
What is the difference between preemptive scheduling and time slicing?
Write a factorial program using recursion in java?
Which api is provided by java for operations on set of objects?
What is meant by class and object in java?
What is a flag variable?