I have arraylist say,
List<CalendarOutput> RecuringEve= Recurrent.eventView(component,begin,end);
and i want to print the arraylist,
CalendarOutput caldavOutput = ListUtil.getReComponent(component, RecuringEve);
here i have method getReComponent(component, RecuringEve)
public CalendarOutput getReComponent(Component component, List recuringEve) {
for(int i = 0; i < recuringEve.size(); i++) {
CalendarOutput.DTSTART_FULL=recuringEve.get(i).toString();
}
retrun CalendarOutput;
}
This method must return value one by one. but it return only the last value of the Arraylist. how can return value one by one
A method returns only once. You cannot make it return many times, but you can invoke a method many times. And if you want to return many values, you can simply collect these values in a list / collection and then return that list / collection.