Explain in detail about encapsulation with an example?
Answer Posted / sanjay singh chauhan
it is way to combine field and mathod in a single entity
like a capsule ;
class A
{
int i;
void m(int i)
{
//body of this mathod ;
}
}
like this way;
| Is This Answer Correct ? | 7 Yes | 0 No |
Post New Answer View All Answers
What java is used for?
How to make a non daemon thread as daemon?
What is set string?
How do you write a scanner class in java?
What do you mean by formatting?
What does s mean in regex?
What is close method? How it's different from Finalize & Dispose?
How many unicode characters are there?
What is the difference between size and length in java?
Is java an ide?
Can you use this() and super() both in a constructor?
How do you compare two objects?
Is array size fixed in java?
Explain java code for recursive solution's base case?
If a method is declared as protected, where may the method be accessed in java programming?