import java.util.*;
class B {
public static void main (
String[] args) {
Object m = new LinkedHashMap();
System.out.print((m instanceof Collection)+",");
System.out.print((m instanceof AbstractMap)+",");
System.out.print((m instanceof HashMap)+",");
}}
What is the result of attempting to compile and run the program?
a. Prints: false,false,false
b. Prints: false,false,true
c. Prints: false,true,false
d. Prints: false,true,true
e. Prints: true,false,false
f. Prints: true,false,true
g. Prints: true,true,false
h. Prints: true,true,true
i. None of the above
The answer given is d)-false, true, true.
Is 'false,true,false' not the corect answer?
"m instanceof HashMap" -How does this evaliate to true?
HashMap and LinkedHashMap are classes implementing the Map interface and there is no inheritance involved between them.