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
Are private methods final?
What is the use of default method in interface in java?
How do you reverse a list?
Why do we use predicate in java?
How do you find the independent variable?
When throws keyword is used?
What is charat java?
How does thread synchronization occurs inside a monitor? What levels of synchronization can you apply?
What is the difference between checked exception and unchecked exception?
What is the purpose of the main method?
What is java virtual machine? Explain
Why we used vector class?
What is memory leak and how does java handle it?
How do you use find and replace?
Tell us something about set interface.