title: Java Encapsulation Concept not clear
body: <p>This is basic question but still i don't understand encapsulation concept . I did't understand how  can we change the properties of class from other class.because whenever
  we try to set the public instance value of class we have to create object of that class and then set the value.and every object refer to different memory.so even if we change
  the instance value this will not impact to any other object.</p>
  
  <p>Even I try to change using static public instance value also i am not able to change the class property value.</p>
  
  <p><strong>Example is given below</strong></p>
  
  <pre><code>// Employee class
  public class Employee {
      public static int empid;
      public static String empname;
  
      public static void main(String[] args) {
          System.out.println("print employe details:"+empid+" "+empname);
      }
  
      // EmployeeTest  class
      public class EmployeeTest {
  
          public static void main(String[] args) {
              Employee e = new Employee();
              e.empid=20;
              e.empname="jerry";
              Employee.empid=10;
              Employee.empname="tom";
          }
  
      }
  }
  </code></pre>
  
  <p>Every time I run <code>Employee</code> class I am getting same value</p>
  
  <p><code>print employe details:0 null</code></p>
  
  <p>Even though I am not following encapsulation concept and I am not able to change public instance value of employee class.Please help me to understand the concept where i am going wrong.</p>