97~127までの数値(int型)をキャストで文字(char型)にするプログラムです。
この機能は初めて知りました。
// 新規作成 2021/6/25
// Aunthor 乃木坂好きのITエンジニア
public class CharTest {
public static void main(String[] args) {
//配列を定義する
int[] moji = {96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127};
//拡張ループ文で数値(int型)を文字(char型)に変換してループ文を回す
for(int i:moji) {
System.out.println((char)i);
}
}
}