1.

How is Collection different from Collections in Java?

Answer»

Collection is an interface whereas Collections is a java utility class containing only static methods that can operate on collections like ArrayList, Set, Queue, etc. and both belong to Collection Framework and are present in the java.util package.

Since Collection is an interface dealing with the data type of iterable objects, the interface extends the Iterable interface as shown below:

public interface Collection<E>
extends Iterable<E>

Since Collections is a java class, it extends the Object class as shown below:

public class Collections
extends Object


Discussion

No Comment Found