restApplication.getPurposeOfTheLoans () is a list of string type. limit.getPurpose () is a single string value. I want to add all string statements in this list end to end and set them to the limit.setPurpose() statement. How can I do that? I shared my sample code below.
Java sample
String pOfLoan = "";
for (int i = 0; i < restApplication.getPurposeOfTheLoans().size(); i++) {
pOfLoan.concat(restApplication.getPurposeOfTheLoans().get(i) + " ");
limit.setPurpose(pOfLoan);
}