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
Programmers Guide To Java SE 8 Oracle Certified Associate OCA
ISBN: 9780132930215
1st Edition
Authors: Khalid Mughal, Rolf Rasmussen
Question Posted: