Question: Choose the true claim about nested classes in Java, given the following general structure between the outer class A and its nested class B:

Choose the true claim about nested classes in Java, given the following general structure between the outer class A and its nested class B: public class A { } public int x; private static int y; private static class B { private int x; public void foo () { // something } } // and whatever other members there are in A There will exist exactly one B object for each A object that exists. The method foo in B could access the field y of the outer class A. Editing the source code to define a third class C nested inside the class B would result in a compile-time error. The method foo in B could access the field x of the outer class A.
Step by Step Solution
There are 3 Steps involved in it
The detailed answer for the above question is provided below The true claim about nested classes in ... View full answer
Get step-by-step solutions from verified subject matter experts
