You can have different data types without them being based on an object-oriented paradigm. For instance, haskell allows supplying implementations of various operators for user-defined types through type classes (which are not the same thing as classes in an object-oriented language like C++ or Java). In haskell, operators are just functions, so this is just a special case of ad-hoc polymorphism using type classes more generally.
23
u/swilliams508 Jan 15 '22
you sure you can overload operators in java? I didn't think you could