Question: I want to write a method that will create a List of the type I define in the method parameters. So if I have 3 classes: `Student`, `Teacher` and `Janitor`, the method should create a `List` of whatever type is passed in

```
public void methodName(TYPE){  
    List<TYPE> results = new List<TYPE>();  
}

```

What should I be using for `TYPE`?

Answer: 
You can use JAVA generics. One way is to allow all class types to be acceptable, by this.. 

```
public <T> void methodName(Class<T> cl){  
    List<T> results = new ArrayList<T>();  
}

```

or a better way would be to make all classes you want to be accepted derive from an interface, say `Person` and then you can do.. 

```
public <T extends Person> void methodName(Class<T> cl){  
    List<T> results = new ArrayList<T>();  
}

```

This limits the set of classes accepted by the the method, to only those implementing `Person`.
It's not entirely clear what you want, but one option is as follows:

```
public <T>
void methodName(Class<T> clazz) {

    List<T> results = new ArrayList<T>();
    ...
}

```

You could then call it as:

```
methodName(Student.class);

```