Home > DeveloperSection > Forums > Why will javac not accept x = x y
Jeet Verma
Jeet Verma

Total Post:110

Posted on    May-10-2013 2:33 AM

 Java Java 

 1 Reply(s)
 1031  View(s)
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! 


Total Post:604

Posted on    May-10-2013 9:15 AM

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.

Don't want to miss updates? Please click the below button!

Follow MindStick