Page 1 of 1

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

Posted: Sun Oct 28, 2012 8:30 pm
by ETS User
Consider the following answer:

volatile int k;

This answer is only valid for instance variables (data members). It is not valid for local variables as (1) "there is never any need to mark
local variables volatile." -- (http://www.codemiles.com/java/java-vola ... t1406.html) and (2) NetBeans 7.3 Beta provides an error when volatile is used locally, "illegal start of expression".

Recommendation: reword so the test candidate will not consider this statement with local variables.

-- Robert

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

Posted: Mon Oct 29, 2012 7:44 am
by admin
The problem statement has been updated to specify that the declarations are within a class to avoid this confusion.

thank you for your feedback!