Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 read request headers from servlets?

1055


Elucidate servlet attributes and its scope?

1024


What are the uses of servlets?

1143


What are some advantages of storing session state in cookies?

1020


What are the advantages of servlets over traditional cgi?

1104


How do you invoke a Servlet? What is the difference between doPost method and doGet method?

1152


What are the phases of the servlet life cycle?

1134


Servlet is pure java object or not?

1201


Difference between get and post in java servlets?

1046


When to use doget() and when dopost()?

1123


How the servlet is loaded?

1077


What is a servlet-to-servlet communcation?

1182


Whether thread can be used in servlets?

1213


What are the supporting protocol by HttpServlet ?

1202


How do you invoke a servelt?

1132