Prefix: When “++” is in pre-increment mode, i.e., ++number.
Postfix: When “++” is in post-increment mode, i.e., number++.
Each repetition of a loop is called an iteration.
A loop control variable determines how many times a loop runs.
A while loop checks its condition before executing, making it a pretest loop.
A do-while loop executes at least once before checking its condition, making it a posttest loop.
A for loop checks its condition before executing, making it a pretest loop.
An infinite loop runs indefinitely unless stopped externally.
A do-while loop runs its body at least once before checking the condition.
The initialization expression in a for loop (e.g., int i = 0) runs only once at the start regardless of the number of iterations.
An accumulator is used to maintain a running sum or total.
A sentinel value is a special value that signals when there are no more items from a list to be processed.
The PrintWriter class is commonly used in Java to write data to a file.
In Java, the File and Scanner classes are typically used together to read from a file.
When a program is finished using a file, it should close the file to release system resources.
PrintWriter provides print and println methods for file output.
The Scanner class has methods like nextLine() to read lines from a file.
For loop allows initialization of multiple variables, (e.g., for (int i = 0, j = 0; …)).
A variable may be defined in the initialization expression of the for loop (for (int i = 0; …)).
In a nested loop, the inner loop goes through all of its iterations for every iteration of the outer loop.
To calculate the total number of iterations of a nested loop, you multiply the number of iterations of the outer loop by the number of iterations of the inner loop.
In Java, without braces, only the first statement after the while is part of the loop.
