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
Is java same as core java?
What is the purpose of declaring a variable as final?
Does a function need a return?
How is treeset implemented in java?
What is an empirical question?
Why do we create public static method in java?
What is the point of polymorphism java?
What are the two basic ways in which classes that can be run as threads may be defined?
What does %d do in java?
Can a static class implement an interface?
What is the main use of generics in java?
Is object a data type in java?
Explain a situation where finally block will not be executed?
What is an example of a boolean?
What is the use of object and class classes?