Explain in detail about encapsulation with an example?
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;