title: Difference between accessing static instance variables using the keyword this and Class name
body: <p>I have got the following java class. When I am calling the login method in my constructor, I access the static instance variable <code>username</code> using the class name, and the static instance variable <code>password</code> using the keyword <code>this</code>. My question is what is the difference between the two approaches? Which one should be used in what situation?</p>
  
  <pre><code>public class MyClass {
      private Main main;
  
      private static String username = "mylogindetails";
  
      private static String password = "mypassword";
  
      public MyClass(){
          this.main = new Main();
          this.main.login(MyClass.username, this.password);
      }
  
  
      public static void main(String args[]){
          MyClass myclass = new myclass();
      }
  }
  </code></pre>