#### Operator in Java Program-1

**Operator in Java Program – 1**

Operator in java program?

Operator can calculate, check, assign, increase and decrease the value of variable. So operator is heart of java program. I give simple example of operator in java.

“ans = x+y;

In this example ans, x and y are variable;

= (assignment) and + (Arithmetic) are operators. “

So we can easily understand the import of operator in java program language. In this blog we will discuss on arithmetic **[** +,-,*,/,% **]** and special**[** ,,””,{},(),[] **]** operators.

**Arithmetic operator**

+ , – , * , / , % are arithmetic operator in all programming languages. These operators help for mathematic formula of equation. We are familiar with + , – , * and / basic arithmetic operator in C and Cpp. We also work on module [%] operator in java. But I mention one this about module [%] operator is working on double value in java programming. Module [%] operator is not working in double value in C and Cpp.

**Special operator**

All Programming languages have special operators. Every statement or line we will see special operators in our programs. List of special operators are [ “” , {} , () , [] , ; , : ]. So we can say that special operators are very import in java program.

**Program in Arithmetic Operator ans Special Operator:**

class op1

{

public static void main(String args[])

{

double x = 7.3;

int y = 2;

double ans = x%y; // Create an error in C/Cpp

System.out.println(“Ans = ” + ans);

}

}

**Output:**

Ans = 1.29999

**Now Video available on YouTube.**

[sbscrbr_form]

**If you have problem on this blog, you can directly comment or subscribe on website.**

### Share and Enjoy

187total visits,1visits today