hi tushar, Super class dont know about child class.There is a simple class Animal and having one constructor and we are calling constructor in main()function with proper argument.Then why the code is giving comile time error that can't find symbol.
Dog extends Animal, and before a Dog can be constructed, its parent must be. In your code even though it is not typed, the compiler puts in a super() call to a default Animal constructor which doesn't exist (hence the error).
Hi Priya, You are right. I had also thought when i first saw the question but after contemplating over the question i found the problem. we know that ,Compiler checks grammare of language. So even we are not bothering with any other class except Animal in main,it will give error because we are not calling super class constructor. Whatever mustafa is saying its true.