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 trialkunal mehta
Courses Plus Student 262 Pointscan someone please help me with my code.
i am trying to find if a person is minor or major import java.io.Console; public class kunal{ public static void main(String args[]){ string age = Console.readLine("tell me your age "); int kun = integer.parseint(age);
if (kun<18){Console.printf("you are minor");}
if (kun>=18){Console.printf("you are a major");}
}
}
1 Answer
Logan R
22,989 PointsI can't check as I'm about to leave and you're code is slightly messed up, but I bet you it's the following line:
int kun = integer.parseint(age);
Should be:
int kun = Integer.parseInt(age);
It's cap sensitive.
Karen Freeman-Smith
29,248 PointsKaren Freeman-Smith
29,248 PointsWhat is it doing? or not doing? Do you get an error?