- Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathtutorial_19.java
More file actions
Latest commit
22 lines (16 loc) · 529 Bytes
/
Copy pathtutorial_19.java
File metadata and controls
22 lines (16 loc) · 529 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
importstaticjava.lang.System.out;
classDriver {
publicstaticvoidmain(String[] args) {
for (inti = 1; i <= 10; i++) {
out.println("Loop #: " + i);
}
for (inti = 10; i > 0; i-=2) {
out.println("Loop #: " + i);
}
// for each loop will be discussed later in detail as well as arrays
String[] listOfNames = newString[] {"Jeremy", "Ally","Bob","Katy"};
for (Stringname : listOfNames) {
out.println(name);
}
}
}