title: How to get specific object values from java <List> and convert to String Array
body: <p>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:</p>
  
  <pre><code>public class PendingRequests  {
  
      private String requestDate; //Getter &amp; Setter
      private String requestNo; //Getter &amp; Setter
      private String employeeName; //Getter &amp; Setter
  
  }
  </code></pre>
  
  <p>And in the bean I am defining a List called "selectedRequests":</p>
  
  <pre><code>private List&lt;PendingRequests&gt; selectedRequests;
  </code></pre>
  
  <p>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:</p>
  
  <pre><code>for(Object obj : selectedRequests){
      System.out.println("Obj = "+((PendingRequests)obj).getRequestNo());
  </code></pre>
  
  <p>But is it the correct way and what should I do next?</p>