vendredi 29 septembre 2017

Creating a generic list using class object in java

I have a function which i want to make generic. I want below code

public String list(){
    List<EMovieCategory> dataList = DBCompanyContent.getInstance().getDataByDocType(EMovieCategory.class);
    return "";
}

Be something like

public String list(Class cls){
        List<WHAT TO WRITE HERE > dataList = DBCompanyContent.getInstance().getDataByDocType(cls);
        return "";
    }

I couldn`t figure out what to write inside List<***>





Aucun commentaire:

Enregistrer un commentaire