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

Total Post:110

Points:776
Posted on    May-10-2013 2:33 AM

 Java Java 
Ratings:


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


AVADHESH PATEL

Total Post:604

Points:4228
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