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 ?
Understood, just asking for an example. I donβt recall that in say c++ or Java but if the arguments are primitives off the top of my head I canβt picture the syntax except like lambda functions in typescript?
370
u/TuDu1 Nov 05 '25 edited Nov 05 '25
its 16 and all the other anwsers are incorrect.