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
Explain the importance of finalize() method.
What best practices should you follow while writing multithreaded code in java?
What is the difference between comparison done by equals method and == operator?
Can a class have an interface?
Is there any difference between nested classes and inner classes?
How does multithreading take place on a computer with a single cpu in java programming?
What is static synchronization?
What is the generic function?
Can a class be defined inside an interface?
What is the use of a copy constructor?
Explain try and catch keywords in java?
Can we override singleton class?
What are controls and their different types in awt?
Can you instantiate the math class in Java?
Objects or references which of them gets garbage collected?