Anyway, hope you dun mind explaining this very simple type casting to me.
New x = new Newer();
*Assume the two classes are above*
and Newer extends New
so if i put (Newer) x
Does this mean...
Type: Posts; User: kutysam
Anyway, hope you dun mind explaining this very simple type casting to me.
New x = new Newer();
*Assume the two classes are above*
and Newer extends New
so if i put (Newer) x
Does this mean...
I have eventually understood it!
In Code 1, there is no show(Fish f) means it will IGNORE ALL subclassess with method carrying (Fish f) in it.
The first line that it reads will thus be in Fish...
The type where an object is brought into a class and there should be a method 'calling' the object. Kinda hard to describe it.
But if you look at the code at the first post and espacially to
Food...
I did google for that and went through a few youtube videos already. But none of them have that type of example that i'm looking for sadly..
Hmm, do you by any chance have a link to a good tutorial which involves simple polymorphism and objects passing into them?
I'm just very confused with polymorphism when it comes to,
B1 b = new B();...
Hello! This is my first time in this forum. I hope that you guys can help me on this theory question..
It is about polymorphism and I'm not too good at it.
class Food{
public String show(Food...