Hi all,
Everybody here are doing a splended job. Thanks to Internet.
Please see the code below,
I have defined two methods one takes int and another takes long.
There is no problem here and output is
Int Version : 10
But when i put one of the methods in another class and do a inheritance, see code below
This is giving compile time error
Reference to method is ambigious, It is defined in void method(long) and void method(int).
This ambiguity should have arised in the earlier code itself but
it is rightly taking the int method. Why is that, problem arises
only in inheritance. It is a instance of overloading.
Also if I interchange the method declerations and change it as
public void method(long i) in the superclass call and
public void method(int i) in the subclass callsub
It is able to give the output
Int Version : 10
Also I am not able to call the int method in the superclass at all from the subclass.
Can you folks please explain this behaviour.
Your help is highly appreciated.
[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 - Ajith]
[This message has been edited by Ajith Kallambella (edited September 26, 2000).]