Answer:
The program to this question can be given as follows:
Program:
public class data //defining class data
{
//main method
public static void main (String [] as) //declaring main method
{
int userNum = 4; //declare variable userNum and assign value
for (userNum = 1; userNum <= 4; userNum++) //loop for print values
{
System.out.println(userNum); //print values in new lines.
}
}
}
Output:
1
2
3
4
Explanation:
In the above java program code firstly a class "data" is defined, inside this class the main method is defined in which an integer variable userNum is defined that holds a value that is "4".