For example I have a class which starts like this
public class Class<T> {
private ArrayList<Integer> x = new ArrayList<Integer>();
In main when I do
public class Main {
public static void main(String args[]) {
Class x = new Class();
All elements in x should be of Integer type. How can I do something like Class x = new Integer/String ... Class();
So I can specify the type of the objects in x