Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Java 

Java error

I'm writing a simple user input
package caleb.fournier;
import java.util.Scanner;
//This line above must be used if you're using user input
public class Caleb
{

public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
int age;
System.out.println("How old are you?");
age=in.nextInt();
if (age >= 21);
System.out.println("You are old enough to drink");
else
System.out.println("You are not old enough to drink");

}

}

And getting this error
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
Syntax error on token "else", assert expected
then cannot be resolved to a variable

at caleb.fournier.Caleb.main(Caleb.java:15)

PLEASE HELP ME.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Java] by President HolyFeb 8, 2014 11:48 AM 3 193 Feb 8, 2014 11:48 AM
Last Post: Knautschtabak
[C] by A-MANJul 16, 2013 07:20 PM 0 145 Jul 16, 2013 07:20 PM
Last Post: A-MAN
[Java] by CatchMeIfYouCanOct 23, 2012 12:53 PM 6 444 Oct 23, 2012 12:53 PM
Last Post: redpois0n