Suvendu Panda wrote:System.out.println(l.contains(a)); executes it returns true
but when System.out.println(l.containsAll(a)); this statement executes it returns false.
how it is happening ?
can anyoone give me the idea behind the execution?
Your list contains 'a' but does not contain all of "I", "can", "do", "what", "I" and "want"
If that answer doesn't make sense read the
javadoc for List and see what the contains and containsAll methods actually do.