title: Which one of the following class definitions is a valid definition of a class that cannot be instantiated? (Abstract classes)
body: <p>I don't understand why the answer isn't B and C instead of only C.</p>
  
  <p>A. Invalid because you need to make the class abstract since there is an abstract function inside.</p>
  
  <pre><code>class Ghost
  {
      abstract void haunt();
  }
  </code></pre>
  
  <p>B. This is not the correct answer, but I don't understand why since it is an abstract class, and they cannot be instantiated. The other option is that it's an invalid definition, but I don't see how it can be invalid, it only has a function call.</p>
  
  <pre><code>abstract class Ghost
  {
      void haunt();
  }
  </code></pre>
  
  <p>C. This is the correct answer</p>
  
  <pre><code>abstract class Ghost
  {
      void haunt() { };
  }
  </code></pre>
  
  <p>D. It's not a class but a method so it can't be instantiated</p>
  
  <pre><code>abstract Ghost
  {
      abstract void haunt();
  }
  </code></pre>
  
  <p>E. Needs 'abstract' instead of 'static'</p>
  
  <pre><code>static class Ghost
  {
      abstract haunt();
  }
  </code></pre>