• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

some questions, please answer it

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,

i have encountered some questions, please tell me the exact answers

13.Which two techniques can be used to provide polymorphic behavior? Choose two

�Extending a class and adding a new method
�Implementing two interface in same class
�Extending the class and overriding a existing method
�Implementing a interfaces with several different classes


i am sure about 3rd option what other ?
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What are your answers? We don't do people's homework for them here, but you can get help with doing it yourself.

Start by taking your best shot at the answers.
 
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The word polymorphic means many forms (poly = many, mophic = forms).

So, polymorphism happens when an object can take on many forms. It really has to do with the instance that is created.

So, a person is a mammal, and an animal - that's two forms they can take on. A person can also be a spouse - that's another form they can take on. A person can be a dentist or a programmer - those are other forms.

In this scenario, if person were a class, maybe mammal would be a superclass, and perhaps animal would be an ancestor class. Spouse, programmer and dentist all seem like roles to me, so those might be modelled as interfaces.

So, extending a class, or implementing an interface, are ways that an instance of a subclass or implementing class can be polymorphic. That's what polymorphism is all about. Now, how that applies to your question is another story.

-Cameron McKenzie
 
Stop it! You're embarassing me! And you are embarrassing this tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic