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

evaluating an expression gives different value than c compiler

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: 8u192
    • Fix Version/s: None
    • Component/s: core-libs
    • Subcomponent:
    • CPU:
      x86_64
    • OS:
      windows_10

      Description

      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


        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: