-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathIncAndDec.java
More file actions
40 lines (21 loc) · 1.04 KB
/
IncAndDec.java
File metadata and controls
40 lines (21 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package com.example.practice;
public class IncAndDec {
public static void main(String[] args) {
/*
INCREMENTING AND DECREMENTING
in this section, we will apply the increment and decrement operators
1. Create an integer variable that stores the value 10
2. using System.out.println(), output "Initial value: " followed by the value of this variable
3. then use the increment operator on this variable
followed by another System.out.println() call with the output "Value after incrementation: "
followed by the value of the variable
4. Then repeat step 3 with the decrement operator
(make sure to adjust the string output appropriately)
*/
/*
Now, using System.out.println(), print the value of your variable as you increment it
note whether the value of the variable that is returned is already incremented,
or if the returned value is not yet incremented
*/
}
}