This community-built FAQ covers the “Greater/Less Than or Equal To” exercise from the lesson “Learn Java: Manipulating Variables”.
Paths and Courses
This exercise can be found in the following Codecademy content:
Learn Java
FAQs on the exercise Greater/Less Than or Equal To
There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (
) below.
If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.
Join the Discussion. Help a fellow learner on their journey.
Ask or answer a question about this exercise by clicking reply (
) below!
Agree with a comment or answer? Like (
) to up-vote the contribution!
Need broader help or resources? Head here.
Looking for motivation to keep learning? Join our wider discussions.
Learn more about how to use this guide.
Found a bug? Report it!
Have a question about your account or billing? Reach out to our customer support team!
None of the above? Find out where to ask other questions here!
In this lesson System.out.println() is used but in the previous one System.out.print() was used. I assume the latter is wrong since all the way through Java we have used to former with the line (ln) used. Please could someone clarify this for me?
To which lesson are you referring (by lesson name)?
Just remember:
System.out.println() prints whatever content you provide on a new line
System.out.print() prints whatever content you provide on the same line you are already on
It’s not wrong per se because it is dependent on the context of the code you are writing; sometimes you want a specific piece of information to display on a new line, sometimes you want it to stay on the same line
I just looked at the lesson you were talking about (Equals and Not Equals) and saw what you meant. So in that context it didn’t matter because System.out.print(paycheckAmount == calculatedPaycheck); was the only information being displayed so it wouldn’t be jumbled up but I can see how it would confuse some people since we’ve been using System.out.println(); the whole course but just remember the context and different uses for each. Also sorry lol I just realized these comments are probably useless because this is months after you asked the questions but I figured id write it just in case someone else gets stuck in the future
Hi all,
Newbie here, but loving every minute of this experience so far! Quick question/curiosity…
For this exercise, wondering if
double totalRecommendedAmount = 8 * 30; could also be the same variable as…
double totalRecommendedAmount = recommendedWaterIntake * daysInChallenge; for this exercise. And if not, why… as these variable were defined.
I apologize in advance if this is not a good question…
Thanks, Kevin
Yes,
double totalRecommendedAmount = recommendedWaterIntake * daysInChallenge;
was correct.
It gives you the same result.
Cool… nice to know I was on the right track… I originally wrote doubleRecommendedAmount = 8 * 30;, but this was not accepted in the project and they were looking for double… = recommendedWaterIntake * …
Thanks for the quick reply 
Kevin