JAVA OPERATOR AND EXPRESSION programming example

                JAVA OPERATOR  AND EXPRESSION

 

1.       What is the operator?

 

v  In java there are 8 bytes of operator:-

A.      Arithmetic Operator.

B.      Relational  Operator

C.      Logical Operator

D.      Assignment  Operator

E.       Increment and decrement  Operator

F.       Bitwise  Operator

G.     Special Operator

                          Arithmetic Operator:-

§  Type of arithmetic operator:-

A.      (addition)  [syntax + ]

B.      (subtraction) [syntax  - ]

C.      (multiplication ) [ syntax  *]

D.      (division) [syntax  /]

E.       (module division/remainder) [syntax %]

 

2.       Arithmetic  Operator Programming example

class Arithmetic {

public static void main(String args[]);

{

int x=5, y=10, z;

z=x+y;

System.out.println(" the arithmetic value of z="+z);

z=x-y;

System.out.println(" the arithmetic value of z="+z);

z=x*y;

System.out.println(" the arithmetic value of z="+z);

z=x/y;

System.out.println(" the arithmetic value of z="+z);

z=x%y;

System.out.println(" the arithmetic value of z="+z);

 

}

}



Post a Comment

0 Comments