Arithmetic Operators - Java Language Basics

Java examples for Language Basics:Operator

Description

Arithmetic Operators

Demo Code


public class Main {
 
        public static void main(String[] args) {
               /* w ww .jav a 2 s .c  o m*/
                System.out.println("Arithmetic operators example :");
               
                int i = 510 + 210;
                int j = i - 10;
                int k = j * 2;
                double l = k / 6;
               
                System.out.println("i = " + i);
                System.out.println("j = " + j);
                System.out.println("k = " + k);
                System.out.println("l = " + l);
        }
}
 

Result


Related Tutorials