Results 1 to 3 of 3
Thread: string addition??
- 09-03-2008, 09:59 AM #1
- 09-03-2008, 10:15 AM #2Senior Member
- Join Date
- Jun 2008
- Rep Power
Integer.parseInt(a) + .....
- 09-03-2008, 03:41 PM #3
One of the confusing things for beginners. The meaning of the + operator depends on where/how it's used. When used with primiitives like int or long it means: arithmetic sum ie add the values of the two numbers and return their sum.
When used between Strings, it means: concatenate the two strings and return a new String with the 2 strings concatentated. That is what you observed.
- By jesicapalma in forum NetBeansReplies: 4Last Post: 05-24-2010, 09:21 AM
- By alwin in forum New To JavaReplies: 2Last Post: 06-02-2008, 05:30 PM
- By Deo Favente in forum Advanced JavaReplies: 11Last Post: 04-24-2008, 05:34 AM
- By Java Tip in forum Java TipReplies: 0Last Post: 03-28-2008, 08:46 PM