Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

int/char???

 
Lakshmi Manikantan
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • 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).]
 
Alokesh Phukan
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • 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]

 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See this thread for more:

http://www.javaranch.com/ubb/Forum24/HTML/010836.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic