下列代码的执行结果是( )。 public class Test1 { public static void main(String args[]) float t = 0f; int q = 5;

admin2012-12-13  19

问题 下列代码的执行结果是(    )。    public class Test1    {      public static void main(String args[])      float t = 0f;      int q = 5;      System.out.println((t++)*(--q));    }

选项 A、40
B、40
C、36
D、36

答案8

解析 本题考查++和--运算符,表达式 (t++)*(--q)的结果为36.0。
转载请注明原文地址:https://kaotiyun.com/show/nF2p777K
0

最新回复(0)