InterviewSolution
| 1. |
Describe The Collection Framework Hierarchy? |
|
Answer» At the root of the COLLECTIONS framework is Collection interface, it must be implemented by any class that defines a collection. This interface declares the core methods that every collection will have, if any class doesn't implement any of the METHOD then it can THROW UnsupportedOperationException. Then there are List and Set interfaces that extend Collection interface and provided some of its own behaviour that will be further implemented by the classes that implement List and Set interfaces respectively. There is also a Queue interface that extends collection to provide behaviour of a queue. On the other HAND there is MAP interface which provides core methods for the Map implementations. At the root of the Collections framework is Collection interface, it must be implemented by any class that defines a collection. This interface declares the core methods that every collection will have, if any class doesn't implement any of the method then it can throw UnsupportedOperationException. Then there are List and Set interfaces that extend Collection interface and provided some of its own behaviour that will be further implemented by the classes that implement List and Set interfaces respectively. There is also a Queue interface that extends collection to provide behaviour of a queue. On the other hand there is Map interface which provides core methods for the Map implementations. |
|