Which statements are most accurate regarding the following classes?

```
class A {
private int i;
protected int j;
}

class B extends A {
private int k;
protected int m;
}
```
a. An object of B contains data fields i, j, k, m.
b. An object of B contains data fields j, k, m.
c. An object of B contains data fields j, m.
d. An object of B contains data fields k, m.

a The data fields in a superclass are contained in a subclass. Whether the data fields in a superclass can be accessed in a subclass is a visibility issue. A private data field in a superclass cannot be directly accessed in a subclass, but the data field may have the getter or setter methods, which can be used to get or set a data field value.

Computer Science & Information Technology

You might also like to view...

A diagram that shows a continual process.

A. cycle B. process C. pyramid

Computer Science & Information Technology

Although NSFNET offered connectivity to academic researches, it was much slower than the newer CSNET.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology