0 Replies Latest reply on Dec 16, 2016 2:07 PM by David Santamaría

    Errata in text

    David Santamaría

      OCA: Oracle Certified Associate Java SE 8 Programmer I Study Guide: Exam 1Z0-808

      According to the order of operator precedence in java, the way the book resolves the example of 59 page is wrong.

      I think it should be:

      int x = 3;

      int y = ++x * 5 / x-- + --x;

      int y = ++x * 5 / 3 + --x; // x assigned value of 2

      int y = 3 * 5 / 3 + --x; // x assigned value of 3

      int y = 3 * 5 / 3 + 2; // x assigned value of 2

      int y = 15 / 3 + 2;

      int y = 5 + 2;

      int y = 7;

       

      x is 2

      y is 7