I have a method which accepts an Object. The object is a list. The list could be any type. I would like to identify the type of list using reflection and create an instance of the list & iterate over it and print the results.
Different Types of List
List<Customer> customerList = new ArrayList<Customer>();
List<Service> serviceList = new ArrayList<Service>();
List<Product> productList = new ArrayList<Product>();
Method that accepts the list
public void printList(Object genericList){
// identify the type of list
// create the list object
// iterate over the list and print the values
}