About Question com.enthuware.ets.scjp.v6.2.652 :

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

Moderator: admin

Post Reply
ETS User

About Question com.enthuware.ets.scjp.v6.2.652 :

Post by ETS User »


Which of these are not legal declarations within a class?

Explanation:
'static' and 'final' are valid modifiers for both 'variable' and 'method' declarations within a class.
'transient' and 'volatile' modifiers are only valid for 'variables'.
'abstract' and 'native' are only valid for 'methods'.
Note: a class can have only have 'final', 'abstract' and 'public' as modifiers.
By 'variable' and 'variables' are you referring to instance variables, as opposed to local variables?

BTW: The CAPTCHA's that this web page provides are very difficult to decipher. Is there any way to turn down messiness in the CAPTCHA? I spent the last 15 minutes going through many, many CAPTCHA images that were way too difficult, I believe, for the average person to decipher, before I finally deciphered one correctly.

Thank you

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

Re: About Question com.enthuware.ets.scjp.v6.2.652 :

Post by admin »

Yes, the explanation has been updated to:
'static' and 'final' are valid modifiers for both member field and method declarations within a class.
'transient' and 'volatile' modifiers are only valid for member field declarations.
'abstract' and 'native' are only valid for member methods.

Note: a class declaration can have only have 'final', 'abstract' and 'public' as modifiers.
Within a method, a local variable may be declared as final.


Regarding CAPTCHA, I have tried to decrease the hardness. Please let me know if it is better now.

HTH,
Paul.

Guest

Re: About Question com.enthuware.ets.scjp.v6.2.652 :

Post by Guest »

'static' and 'final' are valid modifiers for both member field and method declarations within a class.
OK. Thank you. So by "member field" are you referring to an instance variable that is defined within a class, but outside a method (non local)?

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

Re: About Question com.enthuware.ets.scjp.v6.2.652 :

Post by admin »

Yes.

Guest

Re: About Question com.enthuware.ets.scjp.v6.2.652 :

Post by Guest »

A class can also have strictfp as the modifier?

Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests