//-------------------------------------------------------------------------------------------
// Test creation of subclass constructor(s)
//-------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------
// The Canine superclass
//-------------------------------------------------------------------------------------------
class Canine
{
    String  type;                               //define fields
    boolean domestic;       

//    Canine() {                                //empty constructor
//    }

//    Canine(String kind, boolean dom) {        //constructor
//        type     = kind;
//        domestic = dom;
//    }

}
//-------------------------------------------------------------------------------------------
// The Dog Subclass
//-------------------------------------------------------------------------------------------
class Dog  extends  Canine                  //subclass extends superclass
{
    String breed;                           //add additional fields
    String color;

//    Dog() {                               //empty constructor
//    }

//    Dog(String breed)                     //constructor 1
//    {
//        super("dog",true);                //call the superclass constructor
//        this.breed = breed;
//    }

//    Dog(String breed, String color)       //constructor 2
//    {
//        super("dog",true);                //either call superclass constructor
//        this(breed);                      //or     call constructor1 in this class
//        this.color = color;
//    }

    public String toString( ) 
    {           
        return("Type:" + type     +         //or this.type, or super.type          
         "  Domestic:" + domestic +         //same     
         "  Breed:"    + breed    +         //or this.breed 
         "  Color:"    + color);            //same
    }
}

//-------------------------------------------------------------------------------------------
// The tester class
//-------------------------------------------------------------------------------------------
public class xCanineTest
{
    public static void main (String[ ] args) 
    {
        System.out.println();

        Dog d = new Dog();                              //calling the empty constructor
//      Dog d = new Dog("dalmation");
//      Dog d = new Dog("dalmation","black&white");

        System.out.println(d);
    
    }
}