Originally posted by vignesh hariharan:
then if no operator overloading syntax available.. then how come the language developers created that?? am little confused.. please explain me///
They cheated. When the Java compiler hits on code like
string1 + string2
it knows to compile it to the bytecode for
new StringBuffer().append(string1).append(string2).toString();
That knowledge is hardcoded into the compiler - you won't find any code for it in the source of the String class.
So, if you wanted to have operator overloading for your own classes, you'd need to do the same - writing your own compiler.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus