We are asked to identify an expression which tells us that the object referred to by obj was instantiated from class B and not from class A or C or D. Let's examine the alternatives.
a). obj instanceof B
objects instantiated from class B and class C pass this
test b). obj instanceof A && !(obj instanceof C )
Objects instantiated from class A, class B and class D pass this test
c). obj instanceof B && !(obj instanceof C )
Only objects instantiated from class B pass this test.
d). !(obj instanceof C | | obj instanceof D )
Objects instantiated from class A and class B pass this test
e). !(obj instanceof A) && !(obj instanceof C) && !(obj instanceof D)
None of the objects created from classes A,B,C or D pass this test. The expression (Obj instanceof B) implicitly tellus us (Obj instanceof A) since B is a subclass of A.