I have a superclass called `Animal` with a method called `create` that does:

```
static Animal* Animal::create(const std::string& name)
{
Animal* newAnimal = new Animal();
newAnimal ->name = name;
return newAnimal;

}

```

Now I have a subclass called `Dog`. I want to override the `create` method from `Animal`, but avoid copy and pasting the code that is already in there... I basically want this:

```
static Dog* Dog::create(const std::string& name)
{
Dog* newDog = Animal::create(name); // This is the line that I have trouble with.
newDog->type="dog";
}

```

As I mentioned above, I noticed that C++ doesn't do automatic casting - I come from Java background...

Anyways, I was wondering if this is an acceptable way to fix it and doesn't lead to more headache:

```
  Dog *newDog  = static_cast<Dog *>(Animal::create(name));

```

ADDITIONAL NOTE:
So after reading all the comments and solutions, I guess everyone suggests using constructors. But imagine a case that you are not allowed to modify the Animal class, it has a create method and you want to extend that method. Maybe a more proper way to ask is that: Is it possible to extend the super class create method? Let me know if I am totally off - I am very very very new to c++ so maybe the question is just non-sense in c++ point of view...