Java格式转换优先级

2019年2月12日21:31:44 发表评论 2,010 views
/**
 * Created by xabcd on 2019/2/12.
 */
public class TestJava6_15
{public static void main(String argsp[])
{
    char ch = 'a';
    short a = -2;
    int b = 3;
    float f = 5.3f;
    double d = 6.28;
    System.out.println("(ch/a)-(d/f)-(a+b) = ");
    System.out.println((ch/a)-(d/f)-(a+b));
}
}



结果:
(ch/a)-(d/f)-(a+b) = 
-50.18490561773532

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: