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
How do we go with database connection and log4j integration in servlet?
What is servlet lazy loading?
What are the exceptions thrown by servlets? Why?
Whats the advantages using servlets over using CGI?
What is cookies in servlet with example?
Is servlet a controller?
How can the referrer and the target urls be used in servlet?
Why do we need a constructor in a servlet if we use the init method?
What is servlet and how it works?
What are the phases of a servlet life cycle?
What is servlet mapping?
What is the main purpose of java servlets?
How do you load an image in a Servlet?
Which interface must be implemented by all servlets?
What’s the difference between forward() and sendredirect() methods?