Difference between class, instance and local variables in Java? Example