Page 1 of 1

About Question enthuware.ocpjp.v11.2.1893 :

Posted: Thu May 19, 2022 9:44 am
by Thetri_enth
In this question, the answer ' count' is correct, with the statement " Although count is a local variable but its value does not change anywhere in the code. Hence, it is effectively final and is therefore accessible from the inner class."

However, part of the ' code' is the comment " // lots of code....."

How can we know that count is effectively final, if we do not have all the code?

Re: About Question enthuware.ocpjp.v11.2.1893 :

Posted: Thu May 19, 2022 11:05 am
by admin
This is the standard practice adopted by the exam. Any code that is not shown should be assumed to not affect the answer. In the exam, you will find code snippets (where only a few lines of code are shown, which won't compile on its own) or comments such as //setter and getter go here. You need to assume that that code is valid and the answer doesn't depend on it.