CodeGym /Courses /Java Syntax Zero /Additional lessons for Level

Additional lessons for Level

Java Syntax Zero
Level 4 , Lesson 11
Available

If the topics we've covered aren't clear... Repeat them over and over again until they are :) But we hope that the lessons in this level have given you a good understanding of how to use loops in Java. You also learned what real numbers are and about some of the nuances of working with them. To sort out all the new information in your brain and help you understand how the programming theory is used in practice, we prepared a few additional materials for you.

For loop in Java

They say that the best programmer is the lazy programmer. Instead of repeating the same operations several times, the smart programmer will come up with an algorithm to do the necessary work for him or her. And do it so well so that it doesn't need to be redone. In some cases, a for loop will help you write the smallest required number of lines of code. In this article, we dive into its operating principles and examples of using them to solve various problems.

The while statement

Our very first programs were a sequence of instructions executed one after another, but programming work very often involves problems that require a completely different approach. The while loop puts multiple actions into a concise and understandable structure. And that's exactly what we'll talk about.


Comments (5)
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION
m-troja Level 21, Warsaw, Poland
1 January 2024
would be nice to see the correct answers
Grzesiek Level 9, Poland
28 March 2024
Refresh page or exit and open page again - you'll have possibility to do it again
3 December 2023
1 of them is very tricky, first I thought it will do but not printing anything out, 2nd I tried with jshell it said Error, now before 3rd time I am sure it will not compile be the good answer as it won't do it with an error, but why it is an error when it never use the System.out.println I don't get it... Compiler doesn't compile stupid but good code? strange
kowshi Level 6, India
8 June 2023
don't know
Anonymous #11327128 Level 5, Azerbaijan
16 April 2023
But how do we see the correct answers for the questions answered not correctly?