title: How does a '.class' property work?
body: <p>First time developing in Java, and first time developing for Android, so it's quite a newbie question. </p>
  
  <p>I currently have this code:</p>
  
  <pre><code>public void onBtnClicked(View v){
      /** Handles button navigation */
  
      @SuppressWarnings("rawtypes")
      Class c;
      int viewId = v.getId();
  
      switch (viewId) {
  
      case R.id.btnNewTourny :
          c = NewTourny.class;
          break;
      case R.id.btnTeamEditor :
          c = EditTeam.class;
          break;
      case R.id.btnCatEditor :
          c = EditCat.class;
          break;
      case R.id.btnLoadTourny :
          c = EditCat.class;
          break;
      case R.id.btnNewCategory :
          c = NewCat.class;
          break;
      default :
          c = Main.class;
      }
  
      Intent myIntent = new Intent(v.getContext(), c);
      startActivityForResult(myIntent, 0);
  }
  </code></pre>
  
  <p><strong>Short question:</strong></p>
  
  <p>What does the <em>.class</em> property do, f.ex. in '<em>c = NewTourny</em><strong>.class</strong>'?</p>
  
  <p>Why can't I cast c as Tourny (which is the parent of all these classes)?</p>
  
  <p><strong>Long question:</strong></p>
  
  <p>This currently handles all button navigations throughout my app, and works fine. However, as you can see, I've suppressed a 'rawtype' warning, that comes when I cast c as a Class .
  Now, I really want a code without warnings, so I thought 'well, all these classes are a child of 'Tourny'', so I thought it would work, casting c as Tourny - but that does not work. Then I realised, that I didn't really know what the code "NewTourny.class" actually did, and that may be the clue to why I couldn't cast c as Tourny. So, what does .class do?</p>