Tech Mahindra Interview Question

1. Write a program to iterate through all the elements of any class of Collection Framework. 3.Difference between error and exception.