title: What is a better coding practice , use implements or methods
body: <p>i'm using a navigation drawer in android and i've build a listener of two ways.
  but in all programming codes how would be better code? </p>
  
  <p>1) the first method i implements a class</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener{  
  
   NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
  navigationView.setNavigationItemSelectedListener(this);
  
  @Override
  public boolean onNavigationItemSelected(MenuItem menuItem) {
  //CODE
  }
  }
  </code></pre>
  
  <p>2) in the second way i just use a instance. </p>
  
  <pre><code>NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
  navigationView.setNavigationItemSelectedListener(
              new NavigationView.OnNavigationItemSelectedListener() {
                  @Override
                  public boolean onNavigationItemSelected(MenuItem menuItem) {
                      //CODE
                  }
              }
      );
  </code></pre>
  
  <p>what do you think is better and why?
  Thanks =)</p>