Use the class definition below to answer the followingquestions. [Total 8 Marks]
public class TrafficLight {
String stopLight = \"red\";
String waitLight;
String goLight;
public void setStopLight(String colour) {
stopLight = colour; }
public String getGreenLight() {
return goLight; } }
1 :How many field attributes are there in the TrafficLightclass?
2 :Name a field attribute for this class.
3 :What is the name of the method that is an accessor?
4 :What is the name of the method that is a mutator?
5 :What is the output type for the setStopLightmethod ?
6 :Write a Constructor for the TrafficLight class that setsstopLight value to “red”, waitLight to “yellow” and goLight to“green”?