Section Three: Writing Code (Program Two)

 

class ManyFields

{

    private String str;

    private int num;

    private boolean bool;

 

    public ManyFields ()

    {

        str = "Foo good times and foo bad";

        num = 34;

        bool = true;

    }

    public ManyFields (String s)

    {

        str = s;

    }

    public ManyFields (int n)

    {

        num = n;

    }

    public ManyFields (boolean b)

    {

        bool = b;

}

}