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

Why is servlet used?

778


What do you mean by request dispatcher in servlet? Also explain its methods.

705


What is servlet and its use?

716


How does java thread pool work?

635


How do you communicate in between Applets and Servlets?

697






What is servlet? Explain

663


How do we call one servlet from another servlet?

662


What if we pass negative value in load-on-startup?

894


What does the term localization refer to?

666


Can we use threads in Servlets?

735


What is called Scriptlet?

715


How can you create a session in servlet?

678


What is war file?

660


What is the use of welcome-file-list?

645


I have a requirement Here we have a ResultSet object that will contain 50 records i need to print those recors in to a webpage(i.e; view according to MVC architectures that mybe servlet or jsp) . Here i need to print the records 10 per page that is 1 to 10 in page one and 11 to 20 in page two like remaining will be appeared in other pages we need to display those page numbers whenever we click on that page number we will go to that page and display 10 records like we will display 5 pages it is like this << 1 2 3 4 5 next >>

2616