Hi,
I'm having trouble understanding why A is correct.
If we look at A, and we first do the mathematical equation before printing, then why is B wrong?
Thanks for the help.
M
About Question com.enthuware.ets.scjp.v6.2.336 :
Moderator: admin
-
- Posts: 4
- Joined: Sun Oct 26, 2014 6:33 am
- Contact:
Online
-
- Site Admin
- Posts: 10046
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question com.enthuware.ets.scjp.v6.2.336 :
Explanation to option 1 says + is left associative. It does not say that mathematical equation has to be done first.
Since + is left associative, option 2 is incorrect.
This explains what is meant by associativity: http://en.wikipedia.org/wiki/Operator_associativity
Once you read the above link, it will be clear.
HTH,
Paul.
Since + is left associative, option 2 is incorrect.
This explains what is meant by associativity: http://en.wikipedia.org/wiki/Operator_associativity
Once you read the above link, it will be clear.
HTH,
Paul.
If you like our products and services, please help us by posting your review here.
-
- Posts: 4
- Joined: Sun Oct 26, 2014 6:33 am
- Contact:
Re: About Question com.enthuware.ets.scjp.v6.2.336 :
Thanks Paul!
Who is online
Users browsing this forum: No registered users and 58 guests