title: How I return array of my class type object?
body: <p>Reedited...</p>
  
  <pre><code>    public EventData getEventDetails(String evtId, String Status) {
      //do some data selection here.
      return evData1;
      }
  
      public EventData[] getAdminAuthEvtDetails(String evtId, String Status) {
      String eId=evtId;
      String status=Status;
      EventData[] evData=new EventData[2];
      EventData[0] evData=getEventDetails(eId,"V");
      EventData[1] evData=getEventDetails(eId,"M");
      return evData;
      }
  </code></pre>
  
  <p>EventData is my java data class. In there I set getters and setters. I want to call getEventDetails method two time one status as verified and other as modified for requested ID and set both evData into one array. In here there give a error couldn't get data into EventData[0] and EventData[1].Is there any error of calling my getEventDetails method?</p>
  
  <p>Finally I got correct code.</p>
  
  <pre><code>    EventData[] evData=new EventData[2];
      evData[0]=getEventDetails(eId,"V");
      evData[1]=getEventDetails(eId,"M");
      return evData;
  </code></pre>