aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes int/char??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "int/char???" Watch "int/char???" New topic
Author

int/char???

Lakshmi Manikantan
Ranch Hand

Joined: Jun 14, 2001
Posts: 30

----------------------------
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).]


lakshmi
Alokesh Phukan
Greenhorn

Joined: May 24, 2001
Posts: 21
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

Joined: May 05, 2000
Posts: 13974
See this thread for more:

http://www.javaranch.com/ubb/Forum24/HTML/010836.html


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
 
jQuery in Action, 2nd edition
 
subject: int/char???