if we declare A B C as inner classes then we can access the others methods no matter we declare those method are private or not. So in the requirement 4th ask that in C class' method 2 it have to call super.method1() then we have an ambiguity because it can call method1 from class A and B
How this impossible?
Under discussion
Comments (3)
- Popular
- New
- Old
You must be signed in to leave a comment
Nobody
26 May 2019, 01:24
Thank you for your confirm. It make me so confuse yesterday. Now i feel more relief. thank you bro
+1
Guadalupe Gagnon
25 May 2019, 19:54
I think there is a legitimate bug in intelliJ that doesn't allow this task to be run. I posted my solve into the online compiler and ran it and got the correct output, but now there is an error in intelliJ saying that there is an ambiguous method call.
Setting A.method1() to hides it from all other classes that are not enclosing it A, so to B and C it is not (and should not be) accessible. I think codegym is aware of the intelliJ issue with this task because if I go to the task page there is no code section, I had to pull up a different task to test it on the online compiler.
It is doing some really weird things in IntelliJ too, like calling the code "method();" inside A.method2() is actually calling C.method1() and definitely should not be doing that. Strange.
+3
Guadalupe Gagnon
25 May 2019, 20:09
Confirmed
.
.
![]()

+3