Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Nirbhay Agarwal
2,852 PointsA query
int age = 12; // we are declaring the age here but its not final
if(age < 13) {
System.out.println("You must be atleast 12 to run this programme")
} // As we have set the age as 12 we will say you must be atleast 12 not 13 to pass this..
//Only if we say if(age < = 13) then we can use the above println as 13
//And it should be less then 13 when the user types in not greater than 13
if(age >= 13) { // then the user can enter greater than or equal to 13 age for further ouput...
1 Answer
Jonathan Grieve
Treehouse Moderator 91,254 PointsTry
if(age < 12) {
For your expression. I think the question is asking for an age of at LEAST 12. So 12 is an acceptable answer but anything less will cause the output in the if block. :-)
Nirbhay Agarwal
2,852 PointsNirbhay Agarwal
2,852 PointsThanks I think I got confused with declaring the value