221k views
2 votes
Consider the following class definitions. public class BClass { private int x; private double y; public void print() { } } public class DClass extends BClass { private int a; private int b; public void print() { } } Suppose that you have the following statement. DClass dObject = new DClass(); How many instance variables does dObject have? a. zero b. two c. three d. four

1 Answer

1 vote

Answer:

dObject will have 2 (two) instance variables.

Step-by-step explanation:

User Vinil Prabhu
by
5.3k points