title: Why cannot use new keyword to initialize abstract class in Java?
body: <p>I have read somewhere that we cannot initialize an interface, for example:</p>
  
  <pre><code>interface MyInterface{};
  </code></pre>
  
  <p>And the following code is definitely illegal:</p>
  
  <pre><code>MyInterface m = new MyInterface();
  </code></pre>
  
  <p>And as I remember the text I have read said: that because the <code>new</code> keyword is used to allocate memory for class members; so in case of interface, we only have abstract functions, so there is nothing to be allocated in an interface; therefore, initializing an interface is prohibited.</p>
  
  <p>OK, that makes sense to me.</p>
  
  <p>But in case of abstract class, we are allowed to declare and define abstract functions, non-abstract function, as well as normal variables;so why we also are not allowed to initialize an abstract class? And because of that, I was wondering when and how variables in an abstract class, if any, are allocated memory?</p>