Greetings everyone, I'm currently teaching a Java class and I wrote a program to demonstrate overriding and overloading and the part of the program that demonstrates overriding doesn't just work, embarassingly. It looks so correct to me. Can anyone see what's wrong? Program listing:
String Method1() from the OverLoadingMethods class should not be capitalized. It should be spelled with a little 'm' ( method1() ). Since the only method1 your overriding class has is in it's super class due to the spelling mistake, it will call the superclass's method1(). If it is more than a spelling mistake repost here again. Jamie
Joined: Jul 05, 2002
Many thanks. We got the answer before the class was over and we are all happy.
subject: Problem with code to demonstrate method overriding.