1.

How are Collections different from Stream?

Answer»

Collections are the SOURCE for the Stream. Java 8 collection API is enhanced with the default methods RETURNING Stream<T&GT; from the collections.

CollectionsStreams
Data structure holds all the data elementsNo data is stored. Have the capacity to process an infinite number of elements on demand
External IterationInternal Iteration
Can be PROCESSED any number of timesTraversed only once
Elements are easy to accessNo direct way of accessing specific elements
Is a data storeIs an API to process the data


Discussion

No Comment Found