Saturday, March 25, 2017

Subtraction Operator

Hi all,

Today I'm going to talk about Subtraction Operator which symbolize by "-". In Java we use this Subtraction Operator for subtraction as well as for symbolize negative values.

Following is an example for usages of Subtraction Operator,

int a = 30;
int b = 10;

int c = a - b;

now the value of c is 20






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

Wednesday, March 22, 2017

Arithmetic Operators in Java

Hi All,

Today I'm going to talk about Arithmetic Operators in Java, Let's take a quick look at what are Arithmetic Operators.

Arithmetic operators take numerical values (either literals or variables) as their operands and return a single numerical value.

Following are the Arithmetic operators we use in day-to-day life.

Addition (+)
Subtraction (-)
Multiplication (*)
Division (/)

In Java we use another Arithmetic operator except above four operators. That is Remainder Operator.

Remainder (%)

I will talk about each and every operator in detail in upcoming posts for now try to understand following chart of Arithmetic operators.