aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes polymorphism Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "polymorphism" Watch "polymorphism" New topic
Author

polymorphism

vishnu hiranamayee
Greenhorn

Joined: Feb 23, 2006
Posts: 17
Hi all ,
please let me know the difference between "+=" and "=+" and which one is the best one to go for.




Thanks in advance
Vishnu
Petrus Pelser
Ranch Hand

Joined: Feb 20, 2006
Posts: 132
Hi

If you use '+=', you can concatenate strings or accumulate a total.

If you use '=+' it has the same effect as '='. The '+' is then evaluated on its own.

There is no '=+' op.
vishnu hiranamayee
Greenhorn

Joined: Feb 23, 2006
Posts: 17
If you use '=+' it has the same effect as '='. The '+' is then evaluated on its own.

There is no '=+' op.


i did't get what u were trying to explain
Petrus Pelser
Ranch Hand

Joined: Feb 20, 2006
Posts: 132
There is no '=+' operator in java. In an expression, the right-hand side is evaluated first. Thus if you have an expression:
ans =+ 5;
then it is the same as:
ans =(+ 5);
which is:
ans = 5;

If you have an expression:
ans += 5;
then it is the same as:
ans = ans + 5;

Hope this is clearer.
vishnu hiranamayee
Greenhorn

Joined: Feb 23, 2006
Posts: 17
Hi Petrus Pelser,


thanks for ur reply .
so =+ and += are no way related to polymorphism?
correct?

Regards ,
Vishnu.
Pran Pal
Greenhorn

Joined: Mar 02, 2006
Posts: 10
No, they are not related to polymorphism.
 
 
subject: polymorphism