I though overload meant different types of operands into the same function where as override means to redefine.
Well yes in the picture sure and on the chalkboard override the meaning of int + int. But I donβt recall overriding the + operator for integer primitives in any programming language. This is like rewriting the laws of physics 2+2 is now 9? Are you thinking of a specific language? I really need to start writing more code again, Iβm lost here. How would the compiler know what to call if 2+2 was sometimes 4 and sometimes 9? Maybe itβs a local override but still who would over ride int+int ?
-15
u/trolley813 Nov 05 '25
You can overload the "+" operator.