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

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

Moderator: admin

Post Reply
TwistedLizard
Posts: 58
Joined: Sat Mar 01, 2014 1:48 pm
Contact:

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

Post by TwistedLizard »

What classes can a non-static nested class extend ?
(Provided that the class to be extended is visible and is not final.)

Given answer is
3: Any Class

Shouldn't option
2: 'Any top level class.'
also be correct?

It's a subset of option 3 and also therefore correct.

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

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

Post by admin »

No, "Any class" is the best option because of the reason you mentioned.
If you like our products and services, please help us by posting your review here.

TwistedLizard
Posts: 58
Joined: Sat Mar 01, 2014 1:48 pm
Contact:

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

Post by TwistedLizard »

ok, thanks.

I thought I remembered answers here where the the logic was that both answers should be included. Maybe that memory is mistaken.

I think that in the actual test, the number of required answers is given.

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

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

Post by admin »

Yes, that depends on how many answers you have to select. If only one then the best answer wins :)
If you like our products and services, please help us by posting your review here.

marcioggs
Posts: 10
Joined: Sat Aug 31, 2019 3:19 am
Contact:

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

Post by marcioggs »

Shouldn't the correct answer be "None of the above" since it can't extend a final class?

Code: Select all

public class Outer {

    final class FinalClass {

    }

    // Compiler error: Cannot inherit from final 'Outer.FinalClass'
    class NonStaticNested extends FinalClass {

    }
}

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

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

Post by admin »

Yes, that's why the last line of the problem statement says: (Provided that the class to be extended is visible and is not final.)
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests