What is meant by Encapsulation? Can you write a class to
explain encapsulation?
Answer Posted / sivakishorereddy(badvel)
-Encapsulation is wrapping of data(Data members) and
associated methods(member functions) into a single unit in
such a way that data can be accessed with the help of
associated methods.
--In a class we can specify the variables(Data members) as
private. So for other classes it will not be accessible.
--Through methods(member functions) only we can access the
member variables or modify them.
--It gives more security for our data. It is nothing but
data hiding.
Is This Answer Correct ? | 19 Yes | 1 No |
Post New Answer View All Answers
Is java hard to learn?
What is a singleton puppy?
What is the exact difference in between Unicast and Multicast object?
What is the name of the java compiler?
How are the elements of a gridbaglayout organized?
What are thread priorities and importance of thread priorities in java?
What is udp in java?
What is polymorphism and what are the types of it?
How big is a gigabyte?
How is abstraction implemented in java ?
How to perform selection sort in java?
When throws keyword is used?
Is the milky way in a void?
How to avoid memory leak in java?
What is defined as false sharing in the context of multithreading?