Some Notes:

1- in.nextInt(); reads an integer from the user, blocks until the user enters an integer into the console and presses ENTER. The result integer has to be saved in order to use it later on, and to do so save it into a variable, something like this:

int value = in.nextInt();

In your code, you need to assign the 3 integers that the user enters to the corresponding variables:

System.out.println("Enter min value: ");
min = in.nextInt();
System.out.println("Enter max value: ");
max = in.nextInt();
System.out.println("Enter increment value: ");
increment = in.nextInt();

2- You are implementing the loop very well, but you just need to use the user's inputs rather than using explicit integers:

for(int i = min; i <= max; i += increment)
{
    System.out.println(i);
}
Answer from Eng.Fouad on Stack Overflow
๐ŸŒ
Dummies
dummies.com โ€บ article โ€บ technology โ€บ programming-web-design โ€บ java โ€บ increment-and-decrement-operators-in-java-172144
Increment and Decrement Operators in Java | dummies
July 1, 2025 - You can also use an increment or decrement operator in an assignment statement: int a = 5; int b = a--; // both a and b are set to 4
Discussions

operator keyword - Decrement operation in Java - Stack Overflow
So I've just started an IT course and as part of it we're learning to code in Java; I have an assignment for next week, and while I have it figured out, I just have a question as to why it works :P... More on stackoverflow.com
๐ŸŒ stackoverflow.com
loops - Decrement by a certain amount on java - Stack Overflow
Update by (Increment/Decrement):decrement Enter starting number:15 Enter update number:3 Enter end number:3 loop#1 value=15 loop#2 value=12 ยท the end number is where the loop would stop and the update number is how much the starting number should decrement by. so far this is the code I have and I'm stuck on how to keep the loop going until the end number. package jaba; import java... More on stackoverflow.com
๐ŸŒ stackoverflow.com
oop - Java Increment / Decrement Operators - How they behave, what's the functionality? - Stack Overflow
Here we can distinguish between pre- and post increment/decrement operators. ... Find the answer to your question by asking. Ask question ... See similar questions with these tags. ... 0 How does the increment operator work on an Integer instance if Java doesn't support operator overloading? More on stackoverflow.com
๐ŸŒ stackoverflow.com
explain this simple increment/decrement operation please

When you put operators ++ or -- in front of variable like ++m or --m, it calculates result and returns new value. When you put them after the variable, it returns the value and then calculates the result.

So, in line 2 it will return 19, but the value in m is 20. Then in line 3 it returns that value of 20, and decreses m to 19. Finally in line 4 it first decrease the value and then returns 18.

More on reddit.com
๐ŸŒ r/learnjava
3
6
June 8, 2020
๐ŸŒ
Freejavaguide
freejavaguide.com โ€บ increment_decrement_operators.htm
Increment & decrement operators - Java tutorial | freejavaguide.com
If we wanted to count down from twenty to zero by twos we could write: -= class CountToZero { public static void main (String args[]) { int i; for (i=20; i >= 0; i -= 2) { //Note Decrement Operator by 2 System.out.println(i); } } } ... Copyright ยฉ 2006-2009 Free Java Guide & Tutorials.
๐ŸŒ
Baeldung
baeldung.com โ€บ home โ€บ java โ€บ core java โ€บ a guide to increment and decrement unary operators in java
A Guide to Increment and Decrement Unary Operators in Java | Baeldung
February 17, 2025 - int operand = 2; operand--; //operand = 1 int number = operand--; // operand = 0, number 1 ยท Similarly, post-increment and post-decrement unary operators should be on their own line rather than including them in larger expressions. In this quick tutorial, we learned about the increment and decrement unary operators in Java.
๐ŸŒ
Oracle
blogs.oracle.com โ€บ javamagazine โ€บ java-increment-decrement-operators
Do you know how to interpret ii[i++]++ in Java?
January 9, 2023 - All that happens is that the contents of the variable are unboxed, the resulting int is incremented or decremented, and then a new Integer is created with that new value. Finally, the reference to the new Integer is assigned to the variable. Look at line 1 considering the information above. The effect would be to assign zero to an element of the array at a subscript one greater than the int value of i before executing the line. A second effect would be that the int value in the object referred to by i would now be one greater than before.
๐ŸŒ
Medium
medium.com โ€บ buzz-code โ€บ java-8-increment-decrement-operator-15e6e66590e0
Java 8 | Increment / Decrement Operator | by Student Kim | Buzz Code | Medium
January 11, 2021 - Like I said in my old post, there are unary operator, which look like a++ , a-- , ++a , --a . But last time I told you both a++ and ++a mean a=a+1 , also a--, --a mean a=a-1 . Today Iโ€™ll finally explain whatโ€™s the differences. So when the unary operator is in front of the variable ++a /--a, we call it as pre-increment/decrement operator.
Find elsewhere
๐ŸŒ
CodeGym
codegym.cc โ€บ java blog โ€บ java numbers โ€บ increment and decrement unary operators in java
Increment and Decrement Unary Operators in Java
Decrement as the name implies is used to reduce the value of a variable by 1. It is also one of the unary operator types, so it can be used with a single operand. The syntax for decrement operator in Java is a pair of negative signs ie;
Published ย  December 5, 2024
๐ŸŒ
Mathbits
mathbits.com โ€บ JavaBitsNotebook โ€บ Looping โ€บ Increment.html
Increments and Decrements - JavaBitsNotebook.com
increment and decrement operators work only with integer variables -- not on floating point variables and not on literals ยท the execution of the prefix and postfix is under Java control -- nothing you can do will change the order of execution -- parentheses will not force an early execution: ...
๐ŸŒ
Codefinity
codefinity.com โ€บ courses โ€บ v2 โ€บ 8204075c-f832-4cb9-88b1-4e24e74ebdcb โ€บ 3e046a04-a59c-4fc2-95d5-5d34cff8249b โ€บ d5d1873b-9640-4d8b-94de-d61ed41c8651
Learn Increment and Decrement | Loops
1234567891011121314 package com.example; public class Main { public static void main(String[] args) { System.out.println("Increment operation"); for (int i = 0; i < 5; i++) { System.out.println("Iteration " + i); } System.out.println("Decrement operation"); for (int j = 5; j > 0; j--) { System.out.println("Countdown " + j); } } } ... In the first for loop, the variable i is initialized to 0, incremented by 1 after each iteration, and the loop executes until i is no longer less than 5.
๐ŸŒ
Stack Overflow
stackoverflow.com โ€บ questions โ€บ 66329721 โ€บ decrement-by-a-certain-amount-on-java
loops - Decrement by a certain amount on java - Stack Overflow
Update by (Increment/Decrement):decrement Enter starting number:15 Enter update number:3 Enter end number:3 loop#1 value=15 loop#2 value=12 ยท the end number is where the loop would stop and the update number is how much the starting number should decrement by. so far this is the code I have and I'm stuck on how to keep the loop going until the end number. package jaba; import java.util.Scanner; public class loop { public static void main(String[] args) { Scanner scan = new Scanner(System.in); Scanner input = new Scanner(System.in); System.out.print("Update by (Increment/Decrement):"); String
๐ŸŒ
AlgoCademy
algocademy.com โ€บ link
Increment And Decrement Operators in Java | AlgoCademy
Work on coding exercises and projects to reinforce your understanding of these concepts. In this lesson, we covered the increment and decrement operators in Java. We explored their basic usage, different forms (postfix and prefix), and common pitfalls. We also looked at advanced techniques, debugging tips, and best practices.
๐ŸŒ
Codedamn
codedamn.com โ€บ news โ€บ java
Increment (++) and Decrement (โ€“) Operators in Java Explained
June 25, 2023 - If you want to increment or decrement a variable by more than 1, you can use the addition and subtraction assignment operators, such as += and -=, respectively. We hope that this blog post has provided you with a clear understanding of the increment ...
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ java โ€บ interesting-facts-increment-decrement-operators-java
Interesting facts about Increment and Decrement operators in Java - GeeksforGeeks
September 11, 2024 - System.out.println("Pre- Increment \n C = "+ C); //Example- int m = 1, n = 2; int o = m++ + n + ++m; // It goes like m++ = 1, n = 2, ++m = 1+ incremented 'm' from m++ // = 1 + (1+m) = 1+ (1+1) = 3 // o = 1 + 2 + 3 = 6 System.out.println("Example \n o = "+ o); } } Decrement operator is used for decrementing the value by 1. There are two varieties of decrement operators. Post-decrement: Value is first used for computing the result and then decremented. Pre-decrement: Value is decremented first and then the result is computed. Example ยท Java ยท
๐ŸŒ
Dyclassroom
dyclassroom.com โ€บ java โ€บ java-increment-decrement-operators
Java - Increment Decrement Operators - Java - dyclassroom | Have fun learning :-)
So, decrement operator -- decreases the value of a variable by 1. In the following example we are decreasing the value of x by 1. // declare variable int x; // assign value x = 10; // decrease value by 1 x--; Note! x-- is equivalent to x = x ...
๐ŸŒ
Tutorial Gateway
tutorialgateway.org โ€บ increment-and-decrement-operators-in-java
Increment and Decrement Operators in Java
March 26, 2025 - Let us explore the Java prefix and postfix functionalities ยท ++i (Pre increment): It will increment the value of i even before assigning it to the variable i. i++ (Post-increment): The Postfix operator returns the variable value first (i value), and then only i value increments by 1. โ€“i (Pre decrement): It will decrement the value of i even before assigning it to the variable i.
๐ŸŒ
EXLskills
exlskills.com โ€บ courses โ€บ java basics โ€บ java basics
Decrement | Java Basics - EXLskills
August 1, 2018 - package exlcode; public class ... operator, there are two different ways to use the decrement operator called prefix and postfix decrement....