evaluating an expression gives different value than c compiler

XMLWordPrintable

    • Type: Bug
    • Resolution: Not an Issue
    • Priority: P4
    • None
    • Affects Version/s: 8u192
    • Component/s: core-libs
    • x86_64
    • windows_10

      ADDITIONAL SYSTEM INFORMATION :
      windows 10 ,java 8

      A DESCRIPTION OF THE PROBLEM :
          public static void main(String s[]){
              int value=3;
              value = ++value + value++;
              System.out.println(value);
      }

      getting an output as 8 where as c gives an output as 9. why? According to concept it should be 9.

      REGRESSION : Last worked in version 8u192


      FREQUENCY : always


            Assignee:
            Pallavi Sonal (Inactive)
            Reporter:
            Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: