I need your assistant and help in getting the values of an object in a Java and then to convert the output to String Array so I can pass it to a procedure. Here is my Java class:
public class PendingRequests {
private String requestDate; //Getter & Setter
private String requestNo; //Getter & Setter
private String employeeName; //Getter & Setter
}
And in the bean I am defining a List called "selectedRequests":
private List<PendingRequests> selectedRequests;
The selectedRequests is having values and I need to get the values of the requestNo from it and then convert it to String Array. With my attempts, I was only able to print them in the console by using the below code:
for(Object obj : selectedRequests){
System.out.println("Obj = "+((PendingRequests)obj).getRequestNo());
But is it the correct way and what should I do next?
for(PendingRequests obj : selectedRequests)if yourArrayListis declared with the GenericPendingRequests