Study for the Test After Quiz

By Mickey Arnold
Last updated 10 months ago
3 Questions
DIRECTIONS : Complete each of the empty methods below.
public class Chicken{
//data not shown
public Chicken(String n, int a){
//code not shown
}
//other methods now shown
}
public class Chickens
{
private Chicken[] chicks;
public Chickens(int size)
{
//Code for question 1 goes here//
}
public void add(int spot, Chicken chick)
{
//Code for question 2 goes here//
}
public String toString()
{
return Arrays.toString(chicks);
}
}
public class ArrayOfReferencesQuiz2A
{
public static void main(String args[]) throws Exception
{
//Code for question 3 goes here//
}
}


//Code for question 1 goes here//


//Code for question 2 goes here//


//Code for question 3 goes here//