Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8225693

evaluating an expression gives different value than c compiler

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 8u192
    • 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


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

              Created:
              Updated:
              Resolved: