Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.lang.reflect.*;
import java.util.ArrayList;

public class Main {

    public static void main(String args[]) {

        Type t = IntegerClass.class.getGenericSuperclass();
        System.out.println(t);

        ParameterizedType p = (ParameterizedType) t;
        System.out.println(p.getActualTypeArguments()[0]);
    }
}

class IntegerClass extends ArrayList<Integer> {
    public IntegerClass() {
        // no argument constructor
    }
}