Why we are calling ’ < ’ and ’ > ’ as overloaded operators ?
Doubt in overloaded operators
hello @yashsharma4304
overloading in an oops concept.
operator overloading means that operators will behave differently on different types of operands.
for example if we talk about + operator then if we do 2 + 3 then it will give result as 5.
but if we do “abc” + “def” then it will return “abcdef” (for c++ string)
so clearly behaviour of + is different for differnt type of operator that why we call them overloaded.
same holds for < and > operator we can compare two strings or numbers direclty using < or > hence we call them overloaded
1 Like
Ok thank u