Write an OfficeChair class.
- have two instance variables
- have one static int that is used to keep track of the number of OfficeChairs
- have a default constructor
- have an overloaded constructor – with both data members as input
- both constructors need to add to the static int
Write two lines of code that show how to make an instance of the OfficeChair – one using the default constructor and one using the overloaded constructor.
You do not need to write any getters/setters.
I need know how would you write two lines of code to make an instance.
public class OfficeChair
{
public string function chairSwivel;
private int chairSoftness;
static int chairCount = 0;
}
OfficeChair()
{
chairSwivel = “Yes”;
chairSoftness = “Not Given”;
chairCount = “Not Given”;
}
public OfficeChair( string Str, int num1, static int num2)
{
chairSwivel = str
chairSoftness = num1
chairCount = num2
}
}
public Class officeChairs {
public static void main(String args[])
{
Chair officeChair = new OfficeChair(Yes, Very Soft, 8)