About Question enthuware.ocpjp.v7.2.1360 :

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

Moderator: admin

Post Reply
EpicWestern
Posts: 17
Joined: Wed Jan 22, 2014 12:35 pm
Contact:

About Question enthuware.ocpjp.v7.2.1360 :

Post by EpicWestern »

I thought it was a trick question because you can't extend some anonymous classes since there's no way to reference them.

I suppose you could argue that counts as "visibility" but it doesn't seem like quite the same concept to me.

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

Re: About Question enthuware.ocpjp.v7.2.1360 :

Post by admin »

Yes, anonymous classes are not really visible in the sense that you mentioned. So you can exclude that as the question says.

HTH,
Paul.

Chen@ukr.net
Posts: 9
Joined: Sat Feb 27, 2016 1:17 pm
Contact:

Re: About Question enthuware.ocpjp.v7.2.1360 :

Post by Chen@ukr.net »

Code: Select all

public class Outer {

    class Inner extends Outer.Inner.InnerInner{
        class InnerInner{}
    }
    
    public static void main(String[] args) {
        // TODO code application logic here
    }
    
}
will not compile.

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

Re: About Question enthuware.ocpjp.v7.2.1360 :

Post by admin »

Well, it doesn't compile because of cyclic inheritance. Not because of any special restriction on an inner class. It applies to a regular class as well.
-Paul.

Post Reply

Who is online

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