Returning an object Error
<p>My program seems to not understand what I am trying to do and was hoping if someone could help, I'm getting an error saying I need to return an object but I have three return statements all with different conditions:</p>

<pre><code>private Door pickADoor(){
    Random rand = new Random();
    int i = rand.nextInt(3);
    if (i == 2){
      return A;
    }
    else if (i == 1){
      return B;
    }
    else if (i == 0){
      return C;
    }
}
</code></pre>

<p>A,B and C are all pre-defined objects.</p>