You don't have this same problem with methods, because methods can always invoke their superclass's behavior to climb back up the hierarchy. The answer is the number 2. In the object whose data type is declared as class B, i is set to 2. The certification test requires that you understand what's going on with objects and references to objects. Select the single correct answer.
Nothing appears in the standard output.
This question is a classic that cuts to the heart of how Java uses pointers without calling them pointers. When you pass a primitive data type to a method, you are passing that primitive data type by value. This might seem straightforward enough, but the situation is trickier with objects. Each reference has its own four bytes allocated to it and each reference points to the same underlying object. Here is an example involving constructors.