+ 2

Why Java does not support the use of operator overloading?

I know that the only overloaded operator in Java is the '+' operator but why doesn't Java support operator overloading whereas it supports method overloading

4th Nov 2017, 5:18 PM
Bishnu Chetri
Bishnu Chetri - avatar
3 odpowiedzi
+ 3
I have same doubt @Bishnu.
6th Nov 2017, 2:48 PM
Tanmoy Sau
Tanmoy Sau - avatar
0
java was designed to be safe and predictable language, overriding operators is not save, just use methods.
4th Nov 2017, 5:20 PM
Jeremy
Jeremy - avatar
0
Because James Gosling thought programmers couldn't handle it.
4th Nov 2017, 5:24 PM
Schindlabua
Schindlabua - avatar