So I am having trouble trying to loop through an array list but i dont want to use a println statement to print the elements from the array list. Is it possible if i could store all the elements into a local variable through each loop and then return the local variable when i call the method later on?e Here is my code:
public String displayProperties() {
String property = null;
for (int i = 0; i < properties.size(); i++) {
property = properties.get(i);
}
return property;
}