if object is created for both the classes and method is called,why the output is arrrgh arrrgh instead of
arrrgh and a bite?.
i could understand that the arguement differs and byte could not hold int,but still could not guess why the input is as like stated above.
See in 1st case you are creating an instance of monster and in 2nd case you creating instance of child class and assigning to parent class which is known as
Polymorphism, therefore you are getting the same result in both cases. It means in the both cases the
frighten method of monster class get called.