Showing posts with label Additive Operator. Show all posts
Showing posts with label Additive Operator. Show all posts

Friday, March 24, 2017

Additive Operator for String Concatination

Hi all,

Let's take a look how we can use Additive Operator for String concatination. String Concatination means joining two or more String values to make a lager String.

Let's take a look at following example,

String a = "Hello";
String b = "World";

String c = a + b;

Now the value of c is "HelloWorld"


Thursday, March 23, 2017

Additive Operator +

Hi All,

Let's talk about Additive Operator in Java, Symbole of the Additive Operator is "+". As usual Additive Operator act same as in Mathematics. In addition to that in Java we use Additive Operator to String Concatenation. Let's take a look at use of Additive Operator.

Addition

int a = 10;
int b = 20;
int c = a + b;

Now value of c is 30.



According to Operator evaluation from left to right and right to left, at the first place a adding to b and the result value in this case 30 assigning to c.

In my next post I will talk about String Concatenation using Additive Operator