• 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

int/char???

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

----------------------------
The o/p is:-
Starting Process...
false
S
9
----------------------------
shouldn't it be 'R'instead of 'S'. though the one with int arg is inherited in the subclass the one with char arg is more specific, isn't it?? can somebody help me out!!!
------------------
lakshmi
[I added UBB CODE tags to your source code to make it more readable. Please try to use
them in the future. Learn more about UBB codes here - Ajith ]

[This message has been edited by Ajith Kallambella (edited July 17, 2001).]
[This message has been edited by Thomas Paul (edited July 17, 2001).]
 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is no method named InheritanceTest() taking char as argument in the class Process. So there is no dynamic lookup(needs method to be defined in both subclass & Baseclass). And the invocation of the method taking int in class Process takes place printing 'S' instead of 'R' as you expected.

Originally posted by Lakshmi Manikantan:
[B][/B]


 
mister krabs
Posts: 13974
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
See this thread for more:

http://www.javaranch.com/ubb/Forum24/HTML/010836.html
 
Check your pockets for water buffalo. You might need to use this tiny ad until locate a water buffalo:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic