Explain in detail about encapsulation with an example?
Answer Posted / sivaprasad addepalli
Encapsulation is a mechanism which binds the attributes or
variables and methods together as a single entity known as
class.
ex:
class sample
{
public:
int a;
public:
void test()
{
}
}
Encapsulation is a concept of datahiding,
Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
Does isempty check for null?
What are three advantages of using functions?
What is api in java?
What is the use of jtable?
what is the volatile modifier for? : Java thread
What is 32 bit float?
What is finalize()?
what is ststic with example
What is the use of a copy constructor?
How does the java compiler work?
How do you format in java?
What does nextint () do in java?
What is the difference between a synchronized method and a synchronized block?
What causes memory leaks in java?
Difference between == and .equals() ?