Java Collection

What is a collection in java A collection is an object that groups one or more than one element into a single unit. Collection framework provides interfaces and classes to…