title: Checking if a final instance variable has been initialized
body: <p>I am still learning Java but I am not sure why this is causing compile time error:</p>
  
  <pre><code>public class AnswerRepository implements IAnswerRepository
  {
      private final static SQLiteDatabase database;
  
      public AnswerRepository(Activity activity)
      {
          if(database != null)
          {
              database = DbOpenHelper.getInstance(activity);
          }
      }
  }
  </code></pre>
  
  <p>I am just trying to check if a final variable has been assigned first before assigning a value to it. But it seems compile time checking doesn't like it. Why is that?</p>
  
  <p><img src="https://i.stack.imgur.com/8G03z.png" alt="enter image description here"></p>