Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
import java.util.*; class GFC111 { public static void main (String[] args) { Object m = new LinkedHashMap(); System.out.print((m instanceof Collection)+","); System.out.print((m instanceof Map)+","); System.out.print(m instanceof HashMap); }} Is the last print stmt. TRUE ?, can someone explain me..... ~ Shalini
Taurean, LinkedHashMap does not implement the Collection interface as the answer to the question says. LinkedHashMap is a subclass of HashMap (which is a subclass of AbstractMap, that implements the Map interface which does NOT extend the Collection class) Therefore System.out.print(m instanceof HashMap); evaluates to true. Gian Franco
"Eppur si muove!"
Could you hold this kitten for a sec? I need to adjust this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth