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
The reason you are getting the output "print employe details:0 null" when running the Employee class is because those variables are not initialized. That is, you do not assign any values to them within the Employee class.
Whatever you do within the EmployeeTest class will not affect the values of the variables in Employee the next time it is run. Consider each run of a Java program a "clean slate".
On the point of encapsulation, you really should not be using the static keyword. If you are going for encapsulation check out the other answer to this question, it has a nice code sample for you to use.