Answer:
public class GetInfo{
Beverage[] beverages=new Beverage[100];
int i=0;
GetInfo(Beverage b){
beverages[i]=b;
i++;
}
public void Display(){
for(int i=0;i<beverages.length;i++)
cout<<beverage[i].tostring();
}
Explanation:
we are taking Beverages array to store all values and in constructor we are adding that to the list and Display() function prints the vale