实验要求:编写一个JAVA应用程序,该程序在命令行窗口输出希腊字母表
Unicode是用两个字节来编码一个字符,而Ascii是单字节编码,无法表示中文,而Unicode可以表示所有的语言。
希腊字母:α β γ δ ε ζ η θ ι κ λ μ ν ξ ο π ρ ς σ τ υ φ χ ψ ω
public class shiYan {public static void main(String[] args) {char a = 'α';char b = 'ω';int start = a;int end = b;System.out.println("希腊字母表");for(int i=a; i<=b; i++){System.out.print((char)i); //将println改为print就不会换行System.out.print(' ');}}}
结果