What is meant by Encapsulation? Can you write a class to
explain encapsulation?

Answer Posted / srinivasa

All the javabeans written in java follows encapsulation.
In java bean variables are declared as private for
security. will be accessed using setter and getter method.

Is This Answer Correct ?    4 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why we used break and continue statement in java?

804


What is the benefit of singleton pattern?

748


Explain java thread life cycle.

804


What is thread synchronization in java?

669


What checkbox method allows you to tell if a checkbox is checked?

769


What is a instance variable?

779


What is a prefix function.write down a code to compute prefix function.

777


What are design patterns and please explain?

835


Explain the public class modifier?

715


What are the different types of data structures in java?

741


What is ‘is-a ‘ relationship in java?

796


What is the difference between an if statement and a switch statement?

895


What is the use of conditional statement?

749


How do you sort arraylist in descending order?

790


Which graphs are functions?

716