java吧 关注:1,237,493贴子:12,709,516
  • 3回复贴,共1

这道题怎么做?

取消只看楼主收藏回复



IP属地:陕西1楼2016-04-26 22:53回复
    有大神么,讲讲赋值顺序


    IP属地:陕西2楼2016-04-26 23:33
    回复
      结果是


      IP属地:陕西6楼2016-04-27 00:03
      回复
        public class Ten04 {
        static int i = 1;
        public static void main(String[] args)
        {
        i = 4;
        int i = 5;
        Ten04 one = new Ten04();
        i = 3;
        i = 6;
        System.out.println(i);
        System.out.println(one.i);
        System.out.println(one.getI());
        }
        static int getI()
        {
        Ten04 one = new Ten04();
        return one.i;
        }
        }


        IP属地:陕西7楼2016-04-27 00:04
        回复