title: Java variable value initialisation
body: <p>I am a beginner in Java, struggling to understand the following problem with variable initialisation, would appreciate an expert help.</p>
  
  <p>Given the code from an exam:</p>
  
  <pre><code>public class SimpleCalc {
      public int value;
      public void calculate() { value += 7; }
  }
  </code></pre>
  
  <p>AND</p>
  
  <pre><code>public class MultiCalc extends SimpleCalc {
      public void calculate() { value -= 3; }
      public void calculate(int multiplier) {
          calculate();
          super.calculate();
          value *= multiplier;
      }
      public static void main (String[] args) {
          MultiCalc calculator = new MultiCalc ();
          calculator.calculate(2);
          System.out.println(calculator.value);
      }
  }
  </code></pre>
  
  <p>My understanding is that this needs to throw a runtime exception since variable "value" never gets an actual preliminary value assigned to it (public int value;). But, the code works and behaves as if the variable "value" is assigned 0 (same as public int value=0;). Could someone explain please why does this happen? Many thanks</p>