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

(2019.3.11) 运算符优先级

时间:2019-03-11 22:30:36      阅读:210      评论:0      收藏:0      [点我收藏+]

标签:out   class   print   oid   info   src   amp   优先级   com   

class Demo
{
    public static void main(String[] args)
    {
        int x = 0,y = 1;

        /*

        if (++x == y-- & x++ ==1 || --y == 0)
        {
            System.out.println("x="+x+",y="+y);      //x = 2,y = 0;
        }
        else
        {
            System.out.println("y="+y+",x="+x);
        }
        */
        

        if(++x == y--)
            System.out.println("y="+y+",x="+x); //成立!
        else
            System.out.println("x="+x+",y="+y);
    }
}

 

//技术图片

 

(2019.3.11) 运算符优先级

标签:out   class   print   oid   info   src   amp   优先级   com   

原文地址:https://www.cnblogs.com/wu1611312486/p/10513609.html

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