java测试Unicode编码以及数组的运用(初学篇)

 1 /*第二章第四小题*/

 2 /*

 3  * (1)编写一个应用程序,给出汉字“你” ,“我”,“他”在Unicode 表中的位置

 4  * (2)编写一个java应用程序,输出全部的希腊字母

 5  */

 6 public class hello

 7 {

 8     public static void main( String args[] )

 9     {

10      char str[] = {'你','我','他'};   //采用Unicode编码

11      for(int i=0;i<3;i++)

12       System.out.println(+str[i]+"在Unicode编码下的位置 ="+(int)str[i]);

13     }

14 }
View Code

 

你可能感兴趣的:(unicode)