About Question enthuware.ocpjp.v11.2.1893 :

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

Moderator: admin

Post Reply
Thetri_enth
Posts: 6
Joined: Tue May 03, 2022 7:50 am
Contact:

About Question enthuware.ocpjp.v11.2.1893 :

Post 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?

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

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

Post 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.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 38 guests