If I am understanding correctly:
\"A factory constructor affords an abstract class to be
instantiated by another class, despite being abstract.\"
>
The one characteristic of a factory constructor is that the object is not already created at the method start. In the method you can have various mechanisms to create the object, like for example:
abstract class Animal {
String makeNoise(String sound);
String chooseColor(String color);
factory Animal() {
var random = new math.Random();
if (random.nextBool() == true)
return new Cat();
else
return new Dog();
}
}