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
Can constructor return value?
What is a flag variable?
Explain the protected field modifier?
What is the syntax and characteristics of a lambda expression?
Why do you canvas?
Explain differences between checked and unchecked exceptions in java?
What is the difference between choice and list?
How to implement a multithreaded applet?
Can vector have duplicates in java?
Why parsing is done?
Name component subclasses that support painting in java programming?
Explain the difference between private, public, package and protected in java?
What do you mean by jjs in java8?
Can a final variable be null?
What is threaded programming and when is it used? : Java thread