Hi I have these three static objects that I would like to combine programmatically. For example:
private static final String[] DESEASE = new String[] {
"Alcoholism", "Animal Desease", "Brain Desease", "Demantia", "Movement Disorder"
};
private static final String[] GENE = new String[] {
"A1CF", "A2LD1", "A2M", "AA06", "AA1"
};
private static final String[] GEO = new String[] {
"GSE14429", "GSE4226", "GSE8632", "GS9134", "GSE8641"
};
I do not want to iterate. Want to do something of the type:
String[] resultList = DESEASE resultList.addAll(GENE).addAll(GEO);
Strings inresultListto look like? Do you wantresultListto be a 15-element array with all the strings, or do you want a 5-element array with the corresponding strings combined in some way?List<String> list = new ArrayList<>(); Collections.addAll(list,DESEASE); Collections.addAll(list,GENE); Collections.addAll(list,GEO);