I want to declare anonymous arraylist in java so that on the nature of constructor list can be initialize with any type of object. For example:
ArrayList<Anonymous> list;
public AdapterChatWindow(Activity act, ArrayList<CommentData> list, String extras) {
this.act = act;
this.list = list;
}
public AdapterChatWindow(Activity act, ArrayList<ChatHistory> list) {
this.act = act;
this.list = list;
}
Is this possible? Any alternate Solution? Is this possible with list type data structure?