title: Uninitialized variables and members in Java
body: <p>Consider this:</p>
  
  <pre><code>public class TestClass {
  
      private String a;
      private String b;
  
      public TestClass()
      {
      a = "initialized";
      }
  
      public void doSomething()
      {
      String c;
  
          a.notify(); // This is fine
      b.notify(); // This is fine - but will end in an exception
      c.notify(); // "Local variable c may not have been initialised"
      }
  
  }
  </code></pre>
  
  <p>I don't get it. "b" is never initialized but will give the same run-time error as "c", which is a compile-time error. Why the difference between local variables and members?</p>
  
  <p><strong>Edit</strong>: making the members private was my initial intention, and the question still stands...</p>