You can call only the methods defined in the reference type. i.e since the Animal class has only one method ( run() ) you cant call bark() on it, even if its referring to Dog object.
What you are doing is upcasting, you can get to know more about upcasting and downcasting here