title: why we are declaring variables as private in java
body: <p>Normally in java bean classes we are declaring variables as private. Anyhow we are     declaring setter and getter methods as public. Then we are able to get and set the value of    property. So what is the use of declaring variable as private here? What happen if I declare as public?</p>
  
  <p>Thanks in advance..</p>