About Question enthuware.ocajp.i.v7.2.1062 :

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
JeramieH
Posts: 22
Joined: Wed Jan 08, 2014 11:24 am
Contact:

About Question enthuware.ocajp.i.v7.2.1062 :

Post by JeramieH »

Code: Select all

int i4 = i1 + (i2=i3);

First the value of i1 is evaluated (i.e. 1). Now, i2 is assigned the value of i3 ...
Why isn't (i2=i3) evaluated first due to the parantheses, and how do you know when it is or isn't first?

admin
Site Admin
Posts: 10388
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocajp.i.v7.2.1062 :

Post by admin »

If you want to understand this thoroughly, you should go through this: http://docs.oracle.com/javase/specs/jls ... l#jls-15.7

HTH,
Paul.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests