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.
About Question enthuware.ocpjp.v7.2.1360 :
Moderator: admin
-
- Posts: 17
- Joined: Wed Jan 22, 2014 12:35 pm
- Contact:
-
- Site Admin
- Posts: 10388
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1360 :
Yes, anonymous classes are not really visible in the sense that you mentioned. So you can exclude that as the question says.
HTH,
Paul.
HTH,
Paul.
-
- Posts: 9
- Joined: Sat Feb 27, 2016 1:17 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1360 :
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
}
}
-
- Site Admin
- Posts: 10388
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1360 :
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.
-Paul.
Who is online
Users browsing this forum: No registered users and 15 guests