I have an ArrayList, where DataType is a class:
class DataType {
String id;
String dType;
String description;
// setters and getters follow
}
With the given ArrayList<Datatype>, I want to create sub lists, such that every sublist has the same value for dType. i.e all DataType Objects having same value for dType should come in one sublist and so on.
Further, all sublists will be added to an ArrayList<ArrayList<Datatype>> as created.
Could someone please suggest the most appropriate approach for this.