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
Can there be an abstract method without an abstract class?
What is not thread safe?
Can java run on google chrome?
What is run time allocation?
Differences between traditional programming language and object oriented programming language?
What is oops in java?
what do you mean by classloader in java?
Given a singly linked list, find the middle of the list in a single traversal without using temporary variable.
What are the differences between heap and stack memory?
What is the difference between numeric and integer?
Explain importance of finally block in java?
What is ascii code?
What one should take care of, while serializing the object?
What is java english?
How we can execute any code even before main method?