i want to know why we pass object as parameter in an other class and why we pass it?
and can i call instance variable as global variable if i make it static?
public static int applesCreated = 0;
private boolean ripe = false;
public Apple(boolean inRipe)
{
ripe = inRipe;
updateImage(); //method you create to get the proper image for apple based on the value of 'ripe'
applesCreated++;
}
public Apple()
{
this(Greenfoot.getRandomNumber(2) == 0);
}