I am iterating a List<MyDTO>
to get the results. My requirement is to get the first and last name in the list stored in separate String.Any suggestions?
for (MyDTO result : results) {
System.out.println("countName :" + result.getCountName());//returns 20 names
System.out.println("Spread Percent :" + result.getSpreadPercent());
System.out.println("Addr :" + result.getAddr());
}
output:
ASD
xxx
Joh
Joe
xyz
I want the output as:
first Name: ASD
Last Name : xyz