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

How do you configure a centralized error handler in servlets?

763


How do you invoke a servelt?

829


What is difference between server and servlet?

796


Define context initialization parameters.

785


How do you deal property files in servlet?

786


What is called Session Tracking?

831


What is Servlets and explain the advantages of Servlet life cycle?

811


Who is responsible to create the object of servlet?

915


Which interface should be implemented by all servlets?

931


What is the element?

774


Describe in brief RequestDespatcher?

830


Explain Action Servlet?

821


Is it possible to have a constructor inside the servlet?

737


What do you understand by mime type?

790


What are the differences between servlet context vs servlet config?

815