1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

unexpected output

Discussion in 'Java' started by shyam_oec, Feb 24, 2008.

  1. shyam_oec

    shyam_oec New Member

    Joined:
    Nov 26, 2007
    Messages:
    89
    Likes Received:
    1
    Trophy Points:
    0
    Occupation:
    Software Developer, .NET Framework
    Location:
    Jamshedpur
    Code:
    class C
    {
      static int f1(int i)
      {
        System.out.print(i+",");
        return 0;
      }
    
    public static void main(String [] args)
      {
        int i=0;
        i=i+++f1(i);
        System.out.print(i);
      }
    }
    
    
    output of this code is 1,0
    plz explain how?
     
    Last edited by a moderator: Feb 25, 2008

Share This Page