WHY WILL JAVAC NOT ACCEPT X = X Y

Jeet Verma

Total Post:110

Points:776
Posted by  Jeet Verma
Java 
 1320  View(s)
Ratings:
Rate this:
Hi Mindstickians!

From the perspective of Compiler Theory, why would the javac compiler not accept a statement of the form x = x+++++y but accept x = x+++ ++y ?

Thanks in advance! 
  1. AVADHESH PATEL

    Post:604

    Points:4228
    Re: Why will javac not accept x = x y

    Hi Jeet!


    Java has the syntax x++ and ++y so the second one is interpreted as x++ + ++y so it is accepted. the first cannot be accepted using that rule.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!