I have created an array of objects(cups) which I have set a volume and capacity and colour too, all of this is displayed by calling .display() However I can get the display() to do this in this instance when trying to loop through the array of cups. I get no output to show the cups capacity and colour from the display() method, I have added the two bits of code, one in the cups class that contains the display method and the first one which shows me trying to create an array and display each cup. I would deeply appreciate any help as this is a part of a school assignment.
screenshot of current output
public static void main(String[] args)
{
//Makes Array of cups
Cup [] Cups = new Cup[4];
// Creates 4 Cups with 250 capacity and black colour
for(int i = 0 ; i > 4 ; i++)
{
Cups[i] = new Cup (250, ContainerColour.BLACK );
Cups[i].display();
}
//Teapot, Wash and then fill with tea
TeaCup myTeaCup = new TeaCup();
myTeaCup.Wash();
myTeaCup.Fill();
myTeaCup.display();
}
my cups oop code :
// ---------------------------------------------------------------------
// class variables
// ---------------------------------------------------------------------
private ContainerColour myColour;
private int iCapacity;
private int iVolume;
private int iTemp;
private int iFill;
private String SzMaterial;
private Boolean bEmpty;
// ---------------------------------------------------------------------
// Constructors
// ---------------------------------------------------------------------
public Cup()
{
super();
reset();
return;
}
public Cup (Cup original) {
iCapacity = original.getCapacity();
iVolume = original.getVolume();
SzMaterial = original.getMaterial();
}
public Cup(int size)
{
this();
super.setCapacity(size);
setColour(ContainerColour.NOT_SET);
return;
}
public Cup (int size , ContainerColour colour)
{
this (size);
setColour(colour);
return;
}
//setters
public void setColour(ContainerColour c)
{
myColour = c;
}
//getters
public ContainerColour getColour()
{
return(this.myColour) ;
}
//main
public void display()
{
System.out.println("Cup: \nCapacity = " + getCapacity());
System.out.println("Volume = " + getVolume());
System.out.println("Colour = " + getColour() );
if(iVolume == 0) {
bEmpty = true;
}
else {
bEmpty = false;
}
System.out.println("Empty = " + bEmpty );
return;
}
public static void main(String[] args) {
Cup myCup = new Cup();
myCup.setCapacity(250);
myCup.setColour(ContainerColour.WHITE);
myCup.Wash();
myCup.fill();
myCup.display();
}

forclause indicates when the loop should continue, not when it should stop. Consideri < 4rather thani >= 4.display()method? How it's allconnected with the OOP?