forked from naveenanimation20/SeleniumJavaCourse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFor_Loop.java
More file actions
28 lines (22 loc) · 739 Bytes
/
Copy pathFor_Loop.java
File metadata and controls
28 lines (22 loc) · 739 Bytes
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
package Loops;
public class For_Loop {
// for(Variable Initialization; Boolean_Expression Test; Increment/Decrement){
// //Statements
// }
public static void main(String[] args) {
// This will print -- 0,1,2,3,4,5
for(int Increment = 0;Increment<=5;Increment++){
System.out.println("Count is ==> " + Increment );
}
System.out.println("<==== Next Count ====>");
// This will print -- 5,4,3,2,1,0
for(int Decrement = 5;Decrement>=0;Decrement--){
System.out.println("Count is ==> " + Decrement );
}
System.out.println("<==== Next Count ====>");
// This will print -- 0,2,4
for(int Increment = 0;Increment<=5;Increment+=2){
System.out.println("Skip every one another ==> " + Increment );
}
}
}