title: Android class vs this
body: <p><a href="https://github.com/wikimedia/apps-android-wikipedia/blob/master/app/src/main/java/org/wikipedia/bridge/CommunicationBridge.java#L26" rel="nofollow noreferrer">https://github.com/wikimedia/apps-android-wikipedia/blob/master/app/src/main/java/org/wikipedia/bridge/CommunicationBridge.java#L26</a></p>
  
  <p>I was reading the source code of the wiki android app linked above. I stumbled upon this block of code in the constructor of CommunicationBridge class. </p>
  
  <pre><code>    this.addListener("DOMLoaded", (messageType, messagePayload) -&gt; {
          isDOMReady = true;
          for (String jsString : pendingJSMessages) {
              CommunicationBridge.this.webView.loadUrl(jsString);
          }
      });
  </code></pre>
  
  <p>I know the more of the code has to be viewed to understand this but I am a little bit confused about:</p>
  
  <p>1.) in the for each statement we are using pendingJSMessages which is a variable defined earlier in the code (an instance variable). And we are accessing here without using this or CommunicationBridge.this so...</p>
  
  <p>2.) why use CommunicationBridge.this.webView.loadUrl() instead of this.webView.loadUrl()? Whats the difference here.</p>
  
  <p>Thanks, in advance.</p>