karim amrani wrote:
i tought the it will produce "howl woof followed by an exception " BUT it produce a compile error at line 15 ..???
welcome to ranch!!
go to edit and use code tags for writing codes.
because dog class doesn't know about the sniff() method, so it's a compiler error.
why do you think it should give a run-time exception?