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

Answer Posted / abdulrazak

abstract class Person
{
public String sname(){}
Address ad;
}
class Patient extends Person
{

}
class Employee extends Person
{
}
Here in the above example Person is a class acting two ways
one Patient details info and Employee details. We are
achieving this extends Person i.e inheritence.Inheritence
provides code reusability,extensibility

Is This Answer Correct ?    10 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to make sure a servlet is loaded at the application startup?

533


Explain the differences between jsp and servlet.

522


Explain the architechure of a servlet?

580


What is the procedure for initializing a servlet?

525


Can we use the constructor, instead of init(), to initialize servlet?

561






What do you mean by cgi in servlet?

609


Why the concept of single thread model interface is used?

533


Difference between java beans & servlets?

570


Explain the custom jsp tags and the beans.

599


What do you mean by mime type?

527


How can I send user authentication information while making URL Connection?

520


How printwriter is different from servletoutputstream?

555


How can we refresh automatically when new data has entered the database?

599


What do you mean by a filter and how does it work?

522


What is the functionality of actionservlet and requestprocessor?

575