Create own generic types in Java
In the below Java program, I am creating my own Java generic type of class which will be used again in the main method. The above Java program will insert a few words into a private ArrayList and then display them again on the command prompt.