Consider the following code: import java.util.ArrayList;pub…

Questions

Cоnsider the fоllоwing code: import jаvа.util.ArrаyList;public class CustomList {    private ArrayList items;    public CustomList() {        this.items = new ArrayList();    }    public void addItem(T item) {        items.add(item);        System.out.println(item + " added to the list.");    }    public T getItem(int index) {        if (index < 0 || index >= items.size()) {            throw new IndexOutOfBoundsException("Invalid index: " + index);        }        return items.get(index);    }    public void printAllItems() {        System.out.println("All items in the list:");        for (T item : items) {            System.out.println(item);        }    }    public static void main(String[] args) {        CustomList list = new CustomList();        list.addItem("Apple");        list.addItem("Banana");        System.out.println("First item: " + list.getItem(0));       list.addItem(123);         list.printAllItems();    }} Answer the following: 1.) Explain the concept of generics and how it is used within this code sample. 2.) What would the output of the program be? 3.) There are one or more errors in the code.  Identify the error(s), and explain how they should be fixed.