+ 1
what is the defination of operator overloading and why should we use it?
some examples will be nice
2 Antworten
+ 2
There is no should about it. As Java demonstrates, you can never use it and still write any program you want. However, it can make the program easier to understand if used correctly.
Without:
Data value = first.plus(second.times(third));
With:
Data value = first+second*third;