标题:初学者的问题
取消只看楼主
zca4y
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2008-9-23
 问题点数:0 回复次数:0 
初学者的问题
public class DataConversion
{
    public static void main(String[]args)
    {
        byte b;
        int i;
        i=25811;
        b=(byte)i;
        System.out.println(b);
        double d=365.365;
        int i1;
        i1=(int)d;
        System.out.println(i1);
        byte b1;
        double d1=129.123;
        b1=(byte)d1;
        System.out.println(b1);
        char ch;
        ch=(char)(-77);
        System.out.println(ch);
        
    }
}
为什么运行结果是
-45
365
-127
?
结果为365那个还是能理解
2008-09-23 18:18



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-234800-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017208 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved