2. why java doesn't support operator overloading if so the statement System.out.println(string1+"is a string"); mean that '+' is used for concat, but it looks to me that '+' was overloaded Can't help you on issue [1]. Issue [2] is easy...
+ was indeed overloaded for
String concatenation by the designers of Java because they felt the benefit outweighed the cost. They felt differently on the subject of operator overloading in general so the language does not support it. The general feeling, from what I understand and have read, is that it is so difficult to do properly (in terms of design), is so easily abused and leads to such obtuse code that they felt it better left out.
A better question is why they left out an exponentiation operator, at least from my point of view
.
Steve
sgwbutcher@aol.com