0
Beginner problem Query
I don't know what I am doing wrong. I am a beginner in JAVA. Please guide.
2 Answers
+ 3
You need to remove the semicolon in second else if condition.
else if(condition){
}
Also, You're missing a `}` at the end.
+ 1
public class Program {
public static void main(String[] args) {
int age = 40;
if(age <= 17) {
System.out.println("You are small bro");}
else if(age >=35) {
System.out.println("Time for heaven");}
else if(age >= 18 && age <= 34); {
System.out.println("Welcome bro");}
else{
System.out.println("I can't help you bro"); }
}
Whats wrong here ?