Virtual Position Forum
Please register to watch content in detail
Thanks
Admin virtual position


Join the forum, it's quick and easy

Virtual Position Forum
Please register to watch content in detail
Thanks
Admin virtual position
Virtual Position Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Why we are putting + sign in the start of variable and sometimes both ends variable

View previous topic View next topic Go down

GMT + 3 Hours Why we are putting + sign in the start of variable and sometimes both ends variable

Post by Diya Sun May 29, 2011 3:21 pm

Why we are putting + sign in the start of variable and sometimes at both ends of the variable?
For example:
System.out.println("Employee id:" +id+ "Name:" +name);
Diya
Diya
Monstars
Monstars

Taurus Goat
Posts : 364
Join date : 2011-02-08
Age : 33
Notworthy

Character sheet
Experience:
Why we are putting + sign in the start of variable and sometimes both ends variable Left_bar_bleue10/500Why we are putting + sign in the start of variable and sometimes both ends variable Empty_bar_bleue  (10/500)

Back to top Go down

GMT + 3 Hours Re: Why we are putting + sign in the start of variable and sometimes both ends variable

Post by Vuhelper Sun May 29, 2011 3:22 pm

+ sign is used to concatenate values of variables with the string e.g. in your if id variable has value 3 then it would be concatenated as "Employee id:3"
avatar
Vuhelper
Deep Bench
Deep Bench

Posts : 97
Join date : 2011-05-29

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

Permissions in this forum:
You cannot reply to topics in this forum