Chicken Class


Your task for this problem is to create a full Java class, starting with a blank file.

Class Name

The class you create must be named Chicken and must be public.

Instance Variables

The Chicken class should have two instance variables.

  • wingCount is an integer that holds the number of wings that this Chicken has
  • color is a String that contains the color of the chicken


You are going to create two constructors

Default Constructor

The default constructor should set the wingCount instance variable to 2 and the color instance variable to White.

Initialization Constructor

The second constructor should take an int parameter and a String parameter, in that order. The int value needs to be stored in the wingCount instance variable. The String parameter needs to be stored in the color instance variable.

Modifiers / Accessors

You are also going to create modifier / accessor methods for each of the instance variables.

  • getWingCount returns the number of wings
  • setWingCount sets wingCount to a new value. You're probably going to need to pass a parameter to this method.
  • getColor returns the color of the Chicken
  • setColor allows you to change color. You're probably going to need to pass a parameter to this one as well.

Note on Testing

Because you are building an entire class, it's possible that you may see build errors when you test. This is most likely caused either by your class not having the right name - it should be Chicken - or not having both constructors.