ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   SiteMap shows list of All Categories in this site.
Google
 
Categories  >>  Software  >>  Java J2EE  >>  Java Related  >>  Servlets
 
 


 

 
 Core Java interview questions  Core Java Interview Questions
 Advanced Java interview questions  Advanced Java Interview Questions
 Swing interview questions  Swing Interview Questions
 EJB interview questions  EJB Interview Questions
 Servlets interview questions  Servlets Interview Questions
 Struts interview questions  Struts Interview Questions
 JDBC interview questions  JDBC Interview Questions
 JMS interview questions  JMS Interview Questions
 SunOne interview questions  SunOne Interview Questions
 J2EE interview questions  J2EE Interview Questions
 Weblogic interview questions  Weblogic Interview Questions
 Websphere interview questions  Websphere Interview Questions
 Java Networking interview questions  Java Networking Interview Questions
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions
Question
can u give some realtime example in ploymorphism? and 
inheritance?
 Question Submitted By :: Vikneswarank
I also faced this Question!!     Rank Answer Posted By  
 
  Re: can u give some realtime example in ploymorphism? and inheritance?
Answer
# 1
Inheritance is  a concept which involves the concept of re
usability Ex:Bank Accounts-->SB Account,RD Account,CD Account
       Polymorphism concept of one existing in many forms  
   Ex:In Graphical User interfaces,AWT
 
Is This Answer Correct ?    0 Yes 4 No
Walkinglegendteja
 
  Re: can u give some realtime example in ploymorphism? and inheritance?
Answer
# 2
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 ?    4 Yes 4 No
Suresh
 
 
 
  Re: can u give some realtime example in ploymorphism? and inheritance?
Answer
# 3
Polymorphism applies to Overriding
Inheritance applies to Reusability of code defined earlier in one Class and later on used by Other Classes..
 
Is This Answer Correct ?    0 Yes 2 No
Nazneen
 
  Re: can u give some realtime example in ploymorphism? and inheritance?
Answer
# 4
Human being life is the best example for ploymorphism bcoz
Let one take example
im a son of my parents and also brother of my sister and 
the employee of one company ...
Im playing the many role here.
Same example for inheritance also bcoz i have inherited my 
father property.
 
Is This Answer Correct ?    7 Yes 0 No
Mani
 
  Re: can u give some realtime example in ploymorphism? and inheritance?
Answer
# 5
polymorphism: Polymorphism one form existing many forms is
called polymorphism.its used for over ridding.

EX:Man 
Because A Man go to office he is an Employee.
A Man go to movie he is an auditor.
A man walk with his lover she's boy friend 



inheritance is hierarchy of class,that is one class derived
from another class

EX:

grant father
     --father
           --son
 
Is This Answer Correct ?    0 Yes 0 No
Srinu
 
  Re: can u give some realtime example in ploymorphism? and inheritance?
Answer
# 6
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 ?    0 Yes 0 No
Abdulrazak
 

 
 
 
Other Servlets Interview Questions
 
  Question Asked @ Answers
 
How to prevent browser from caching the page content?  1
i have 500 jsp in my application ,with same forward name,it lokks for appropritae jsp from 1 to 500,but i want to send response to 498 page,what should i do Globerian1
what is the control flow in servlet when we send a request?  3
How to deal with multi-valued parameters in a servlet?  2
Life Cycle of servlets?  4
Explain Servlet Chaining ?  1
What is the ServletConfig() and what is its use? Google3
In servlets, Why do we need both GET and POST method implementations? IBM3
what is the advantage of using Servlets over CGI programming?  2
What is connection pooling? Wipro3
can u give some realtime example in ploymorphism? and inheritance? SolutionNET6
What is difference between Forward() and sendRedirect() methode?  9
What is Server-Side Includes? SAS1
What is with the javax.servlet package naming?  2
i am bca student,give me suggest for bright future BSNL10
What is session variable in servlets?  1
What is the need of session tracking in HttpServlet ?  3
What are cookies and how will you use them?  2
What is ServletContext() and what is its use? Prime-Technology4
What is the difference between ExecuteUpdate and ExecuteQuery?  4
 
For more Servlets Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com