페이지 2 / 전체 2
2. 코드
public class Ascii { public static void main(String[] args) { String str = "abcdefghijklmnopqrstuvwxyz"; for ( int i=0; i<str.length(); i++ ) { char c = str.charAt(i); System.out.println(c + " = " + (int)c); } String strUpper = str.toUpperCase(); for ( int i=0; i<strUpper.length(); i++ ) { char c = strUpper.charAt(i); System.out.println(c + " = " + (int)c); } } }