Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

9
  • 11
    So what you're saying is Eric's answer is wrong because Java defines it specifically to be exactly what he said? Commented Aug 7, 2011 at 10:29
  • 8
    The relevant rule in Java (and C#) is "subexpressions are evaluated left to right" - Sounds to me like he's talking about both. Commented Aug 7, 2011 at 16:22
  • 2
    A little confused here - does this make the above answer by Eric Lippert any less true, or is it just citing a specific reference as to why it is true? Commented Aug 16, 2011 at 17:59
  • 6
    @Greenie: Eric's answer is true, but as I stated you cannot take an insight from one language in this area and apply it to another without being careful. So I cited the definitive source. Commented Aug 16, 2011 at 18:53
  • 1
    the odd thing is, the right-hand is evaluated before the left-hand variable is resolved; in a[-1]=c, c is evaluated, before -1 is recognized as invalid. Commented Nov 10, 2015 at 3:13