I am writing to find out whether the user is Teen ager or not? I am getting error while executing the program.
public class TeenNumberChecker
{
public static void main (String[] args)
{
System.out.println(hasteen(22,28,32));
}
public static boolean hasteen(int age1,int age2,int age3) {
if ((age1>=13&&age1<=19)||(age2>=13&&age2<=19)||(age2>=13&&age2<=19))
return true;
}
else {
return false;
}
}
Error i am getting is "Exception in thread "main" java.lang.Error: Unresolved compilation problem: "
{afterif ((age1>=13&&age1<=19)||(age2>=13&&age2<=19)||(age2>=13&&age2<=19))