Java Arithmetic Operators :

The operator taking two operands is called binary operators.
There are different binary operators are as follows :

The Arithmetic Operators:

The Java programming language provides operators that perform addition, subtraction, multiplication, and division. There's a good chance you'll recognize them by their counterparts in basic mathematics.
The only symbol that might look new to you is "%", which divides one operand by another and returns the remainder as its result.

  +   // addition operator (also used for String concatenation)
  -   // subtraction operator
  *   // multiplication operator
  /   // division operator
  %   //remainder operator
 class ArithmeticDemo
      public static void main (String args[ ])
          int x=15,y=4,z;



The + operator can also be used for concatenating (joining) two strings together, as shown in the following program:

  class ConcatDemo
        public static void main(String args[ ])
            String s1 = "Java";
            String s2 = " Race";
            String s3=s1+s2;



Our Services:

Java Training | Python Training | Machine Learning with Python Training | Deep Learning with Python Training | Data Science with Python Training | Projects

Silansoftware Pvt.Ltd, BBSR
Call to: 0674-2361252