About Question enthuware.ocpjp.v8.2.1895 :

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

Moderator: admin

Post Reply
ssoltanid
Posts: 3
Joined: Wed Nov 12, 2014 3:03 pm
Contact:

About Question enthuware.ocpjp.v8.2.1895 :

Post by ssoltanid »

"All final or effectively final static variables"

You probably mean : "All final or effectively final variables"

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

Re: About Question enthuware.ocpjp.v8.2.1895 :

Post by admin »

No, because the question explicitly states, "...if the inner class is defined in a static method of encapsulating class.
If you like our products and services, please help us by posting your review here.

dvc1190
Posts: 15
Joined: Tue Feb 25, 2014 3:14 am
Contact:

Re: About Question enthuware.ocpjp.v8.2.1895 :

Post by dvc1190 »

One of the correct options is "All final or effectively final static or automatic variables".
Does this mean:
(1) All final or effectively final static variables and (2) all final or effectively final automatic variables?
Or, does it mean:
(1) All final or effectively final static variables and (2) all automatic variables?

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

Re: About Question enthuware.ocpjp.v8.2.1895 :

Post by admin »

(1) All final or effectively final static variables and (2) all final or effectively final automatic variables.
If you like our products and services, please help us by posting your review here.

CzakoJanos
Posts: 1
Joined: Thu Mar 25, 2021 2:05 am
Contact:

Re: About Question enthuware.ocpjp.v8.2.1895 :

Post by CzakoJanos »

"All final or effectively final static or automatic variables"

Only the effective final automatic variables defined in the defining static method. And of course the static ones.

Javatje
Posts: 9
Joined: Wed Jun 30, 2021 6:53 am
Contact:

Re: About Question enthuware.ocpjp.v8.2.1895 :

Post by Javatje »

Exactly, automatic variables defined in other methods cannot be accessed, right?

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

Re: About Question enthuware.ocpjp.v8.2.1895 :

Post by admin »

The the problem statement says "..the method..", which means it is talking about the method in which the inner class is defined. It is not about automatic variables of other methods. Automatic variables of one method are never accessible to other other methods anyway.
The explanation also includes a detailed example that illustrates the situation.
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 48 guests