public class DataStructure{
private Listing[] data; // an array of listing objects
private int size = 100;
private int next = 0;
DataStructure(){
// allocate the array to 100 elements
data = new Listing[100];
}
DataStructure(int numberofListings){
this.numberofListings= numberofListings;
}
public void addListing(Listing newListing){
// how would I add a new Listing object to the array at index next
}
public void showAllListing(){
// this method will output the values of the data members of all Listing objects
}
public static void main(String[] args){
DataStructure obj1= new DataStructure();
Listing l1= new Listing();
}
}
public class DataStructure{
private Listi