i can understand it when we want to implement polymorphism in c++ we use virtual functions and function overriding but when we want to implement polymorphism in java then we do not use virtual methods why.
in java we use simply reference object that can store the address and use function overring and polymorphism implements.
Basically my question is that what is the basic difference b/w c++ polymorphism and java polymorphism. plz give me the correct concept about this.
I am not the most experienced person around here but from my experience so far, it really comes to syntax differences, I had to make a banking system in c++ back in the days as a project using multi inheritance and from what I remember the actual differences were:
-creating and deleting objects in c++ by yourself (new, delete) while java has garbige collection
-in c++ you can inherit from multiple classes, in java not exactly, but you can inherit from multiple interfaces which somewhat gets close to the idea behind c++'s multiple inheritance.
As for inheritance its pretty much the same, you need virtual so that the compiler understands it. Also I think there was something with ambigious call error(usage of virtual) but can't remember much about it, if you want you can check the net about it