OnJava8-Examples/control/ListCharacters.java
Bruce Eckel 49edcc8b17 reorg
2015-06-15 17:47:35 -07:00

26 lines
669 B
Java

//: control/ListCharacters.java
// ©2015 MindView LLC: see Copyright.txt
// Demonstrates "for" loop by listing
// all the lowercase ASCII letters.
public class ListCharacters {
public static void main(String[] args) {
for(char c = 0; c < 128; c++)
if(Character.isLowerCase(c))
System.out.println("value: " + (int)c +
" character: " + c);
}
} /* Output: (First 10 Lines)
value: 97 character: a
value: 98 character: b
value: 99 character: c
value: 100 character: d
value: 101 character: e
value: 102 character: f
value: 103 character: g
value: 104 character: h
value: 105 character: i
value: 106 character: j
...
*///:~