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

What do you mean by session tracking?

667


When using servlets to build the HTML, you build a DOCTYPE line, why do you do that?

563


What is load-on-startup in servlet?

580


How can the session in servlet be destroyed?

639


What methodology can be followed to store more number of objects in a remote server?

1815






What are the drawbacks of cgi?

570


Explain how to improve Servlet Performance?

594


How the servlet is loaded?

599


Difference between GET and POST?

707


Why is http protocol called as a stateless protocol?

535


What is the difference between portlet and servlet?

510


What are the types of protocols supported by httpservlet ?

704


What is meant by session? Tell me something about httpsession class?

596


What are the servlet events?

590


How can we perform any action at the time of deploying the project?

621