Skip to content

Commit 9860b79

Browse files
committed
feat: Print "Java" 10 times using a for loop
✅ Logic: - Uses a for loop to iterate from 1 to 10 - Prints "Java" with the current counter on each iteration. Signed-off-by: Somesh diwan <[email protected]>
1 parent b907bc0 commit 9860b79

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed
Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
public class TheForLoop
2-
{
3-
public static void main(String[] args)
4-
{
1+
public class TheForLoop {
2+
public static void main(String[] args) {
53
System.out.println("I'm going to print Java 10 times.");
64
System.out.println("Ready?");
7-
for (int counter = 1; counter <= 10; counter++)
8-
{
5+
6+
for (int counter = 1; counter <= 10; counter++) {
97
System.out.println(counter + " Java");
108
}
119
System.out.println("That was fast!");
1210
}
13-
}
11+
}

0 commit comments

Comments
 (0)