Coin Flip Code Error/Issue
<p>So.. I'm trying to learn more Java, and decided to create a simple heads / tails coin flip, but can't seem to get it to work. Gives error on "else" with "Syntax error on token "else", { expected", but at the end of the line I already have a {. Can anyone explain this to me? or what I am doing wrong? Thanks</p>

<pre><code>import java.util.Random;

class CoinFlip {
    static int flip;
    public static void main(String[] args) {
    coin();
    }

    static void coin() {
    Random rand = new Random();
    flip = rand.nextInt(2);
    System.out.println("You flipped a " + flip);
    heads(flip);
    }

    static void heads(int flip) {
    if (flip == 1)
        System.out.println("Heads");
    }

         else if (flip == 2) {
         System.out.println("You win! Congratulations!");
         }  
      }
}
</code></pre>
