I am finding collections and generics topic hard to follow from reading SCJP 6 guide in kathy sierra guide. Can anyone suggest a basic book for this topic?...(I have head first java but that too is not so good as to clear the basics).
In terms of generics, for the purpose of the exam, ask yourself if you understand these:
1 .ArrayList<String> , ArrayList<?> alist = new ArrayList<String> , ArrayList<? extends Number> numbers = new ArrayList<Integer> , ArrayList<? super Integer> numbers = new ArrayList< Object>,
2. If you have ArrayList<? extends Number> alist = ..., can you do this alist.add(...) ? No.
3. If you have ArrayList<? super Integer> alist = ... , can you do this alist.add(new Integer(10)) ? Yes. How about alist.add(new Object())? No.
Make sure you understand the basics of how generics are applied to collections.
For any questions, let us know.
subject: Finding "Collections and Generics" chapter difficult to grasp in scjp 6 study guide..