码迷,mamicode.com
首页 > 其他好文 > 详细

Character Comparison

时间:2017-06-15 23:44:03      阅读:343      评论:0      收藏:0      [点我收藏+]

标签:dex   throws   []   class   err   row   exce   tput   iso   

    public static void main(String [] args) throws InterruptedException {
        System.out.println("a-z: "+(‘a‘-‘z‘));
        System.out.println("a-A: "+(‘a‘-‘A‘));
        System.out.println("a-Z: "+(‘a‘-‘Z‘));
        System.out.println("A-Z: "+(‘A‘-‘Z‘));
        System.out.println("A-9: "+(‘A‘-‘9‘));
        System.out.println("a-0: "+(‘a‘-‘0‘));
        System.out.println("z-0: "+(‘z‘-‘0‘));
        System.out.println("z-A: "+(‘z‘-‘A‘));
        System.out.println("z-Z: "+(‘z‘-‘Z‘));
        System.out.println("A-0: "+(‘A‘-‘0‘));
        System.out.println("Z-0: "+(‘Z‘-‘0‘));
    }

Output

a-z: -25
a-A: 32
a-Z: 7
A-Z: -25
A-9: 8
a-0: 49
z-0: 74
z-A: 57
z-Z: 32
A-0: 17
Z-0: 42

So the summary is:

0 < 9 < A < Z < a < z

Character Comparison

标签:dex   throws   []   class   err   row   exce   tput   iso   

原文地址:http://www.cnblogs.com/codingforum/p/7020548.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!