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
About Question enthuware.ocajp.i.v7.2.1298 :
Moderators: Site Manager, fjwalraven
-
- Site Admin
- Posts: 10388
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1298 :
The problem statement has been updated to specify that the declarations are within a class to avoid this confusion.
thank you for your feedback!
thank you for your feedback!
Who is online
Users browsing this forum: No registered users and 10 guests