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 ruby built on java?
What is complexity in java?
Write a program based on Java script program.
What is compareto () in java?
When arithmeticexception is thrown?
What is string in java?
What is the difference between reader/writer and inputstream/output stream?
Can the garbage collection be forced by any means?
Which sorting algorithm is best in java?
What are the types of strings?
What comes to mind when someone mentions a shallow copy in java?
What is a protected class in java?
What is private static class in java?
What are autoboxing and unboxing? When does it occur?
Explain the difference between throw and throws in java?