can u give some realtime example in ploymorphism? and
inheritance?

Answer Posted / suresh

inheritance is hierarchy of class,that is one class derived
from another class

example:
grant father
--father
--son

polymorphism is the ability to take more than one form

example:
compile time polymorphism
--method overloading
people can act many role in the world
home:father
company:employee
run time polymorphism
--method overriding
dog is a class
It contains smile method

Is This Answer Correct ?    36 Yes 15 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you explain in detail 'javax.servlet' package?

537


Can we override destroy method in servlet?

493


What is java servlet?

603


What are the differences between forward() method and sendredirect() methods?

541


What are the life cycle methods of a servlet?

583






Is it good idea to create servlet constructor?

732


What is the life-cycle of servlets?

626


What is load-on-startup in servlet?

578


How printwriter is different from servletoutputstream?

570


Which http method is said to be non-idempotent and idempotent?

601


Difference between GET and POST?

700


What is a servlet-to-servlet communcation?

639


Whether we can get deadlock situation in servlets?

570


How is a servlet implemented in code?

560


What are the features added in Servlet 2.5?

760