Ankit Garg wrote:Someone did some extensive experimentation on this here. The results are interesting...
Ankit Garg wrote:When you iterate over elements sequentially, ArrayList is slower than LinkedList. ArrayList is faster in random access of elements, LinkedList is slow in that...
Neha Daga wrote:1 is answer becuse at runtime the object type is taken into consideration not the reference type, so at runtime jvm sees it as object D being casted to E and d implements E through its superclass so no exceptions will be there.
Neha Daga wrote:in this question there is no option saying "result is not predictable", and "good" is the only answer that may be a possible output so in this case I think 1 is correct answer.