+ 3
A method that multiplies two objects in java
is it possibile? if yes how it's achieved?
5 Answers
+ 11
@Andrey Yes, it's overloading of course, sry for that. He asked for Java (tags).
+ 9
Well, you cannot override the operator * but you can create a method named multiply and do whatever you want to do there.
+ 8
please explain what you are trying to mutliply and what kind of object. this way we may help
+ 6
@Tashi N Yes, I've checked language tags. But if we are still talking about operators overloading it is not possible in Java and possible in C++ so I've mentioned C++.
+ 5
@Tashi N As far as I know it's called "overloading" (not overriding). It's in most context... and surely for C++ where operator overloading exists. "Overriding" is a term for virtual functions/methods overriding. Here you can check: http://stackoverflow.com/questions/3803970/what-is-the-difference-between-operator-overloading-and-operator-overriding-in-c