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
What is not thread safe?
How do constructors use this() and super()?
How many bits is a 64 bit byte?
What does serializing data mean?
Is zero a positive integer?
How to implement an arraylist in java?
What is n in java?
What is a text string?
What is polymorphism and what are the types of it?
What are streams in java 8?
What are autoboxing and unboxing? When does it occur?
Why do we need wrapper class?
What are the 7 types of characters?
How to change the priority of thread or how to set priority of thread?
What exactly is a .class file?