Again- what happened when you tried it? Did you write a simple program to test what happens in different scenarios? With more than one subclass?
We aren't a compiler- the compiler is a compiler.
Type: Posts; User: KevinWorkman
Again- what happened when you tried it? Did you write a simple program to test what happens in different scenarios? With more than one subclass?
We aren't a compiler- the compiler is a compiler.
It seems like you could correct yourself even more easily (and definitely more reliably) if you simply created a basic program that tested your theories. Then you can report your findings to us!
That must mean you're looking at some basic tutorials, which is fine- but I wouldn't bother focusing on the finer points of OOP if you're still on the basic tutorials. It'll come to you in time....
What type of example are you looking for, exactly?
First google hit: Polymorphism (The Java™ Tutorials > Learning the Java Language > Interfaces and Inheritance)
I'm not really sure what your question is- that's just how it works, according to the JLS. What did you expect to happen?