Given three classes A, B, and C, where B is a subclass of A, and C is

Question:

Given three classes A, B, and C, where B is a subclass of A, and C is a subclass of B, which one of these boolean expressions is true only when the reference o refers to an object of class B, and not to an object of class A or class C?

Select the one correct answer.

(a) (o instanceof B) && (!(o instanceof A))

(b) (o instanceof B) && (!(o instanceof C))

(c) !((o instanceof A) || (o instanceof B))

(d) (o instanceof B)

(e) (o instanceof B) && !((o instanceof A) || (o instanceof C))

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: