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
How does enum work in java?
Explain the public class modifier?
What is callablestatement? How you can call stored procedure to pass in parameter?
Is main a keyword in java?
What are byte codes?
Can we overload the methods by making them static?
What is replaceall in java?
Can we have 2 main methods in java class?
Why do we need singleton class?
What do you mean by inner class in java?
Can an abstract class be a final class?
I have multiple constructors defined in a class. Is it possible to call a constructor from another constructor’s body?
Can we override private method in java?
If A Class Is Declared Without Any Access Modifiers, Where May The Class Be Accessed?
What is meant by main method?