Multiple Choice Question

Quiz Guidelines

 

QID: 
397
Question: 

Consider :
class A {}
class B extends A {}
class C extends B {}

Which of these boolean expressions correctly identifies when an object 'o' actually refers to an object of class B and not of C?

Select 2 options

A. (o instanceof B) && (!(o instanceof A))
B. !((o instanceof A) || (o instanceof B))
C. (o instanceof B) && (!(o instanceof C) 
D. ! ( !(o instanceof B) || (o instanceof C))
E. (o instanceof B) && !((o instanceof A) || (o instanceof C))

Q&A Set: 

Search the Web

Custom Search

Searches whole web. Use the search in the right sidebar to search only within javajee.com!!!