public class MyClass {
private char e;
public void intializeVariable(char z) {
this.e = z;
}
public void intializeVariableWithoutThis(char z) {
e = z;
}
public static void main(String[] args) {
MyClass mC = new MyClass();
System.out.println(mC.e);
mC.intializeVariable('m');
System.out.println(mC.e);
mC.intializeVariableWithoutThis('n');
System.out.println(mC.e);
}
}
The methods initializeVariable and initailizeVariableWithoutThis are doing the same thing I just want to understand what is the difference in setting the value using this.e = z and just doing e = z