Showing posts with label Evolution order of operands. Show all posts
Showing posts with label Evolution order of operands. Show all posts

Java Evolution order of operands / Chapter -13/ Operator & Assignments



Evolution order of operands

Java Evolution Order Of Operands


In JAVA we have only operator precedence but not operand precedence before applying any operator all operands will be evaluated from Left →Right.

example:-


class Test
{
      public static void main(String [ ] args)
      {
           System.out.println(m1(1) + m1(2) * m1(3)  / m1(4) + m1(5)  * m1(6) );
      }
      public static int m1(int i)
      {
             System.out.println( i );
return i;
           }
}

Java-Evolution order of operands / Chapter -13/Operator & Assignments

In JAVA we have only operator precedence but not operand precedence before applying any operator all operands will be evaluated from Left →Right.

example:-


class Test
{
      public static void main(String [ ] args)
      {
           System.out.println(m1(1) + m1(2) * m1(3)  / m1(4) + m1(5)  * m1(6) );
           }
      public static int m1(int i)
      {
             System.out.println( i );
                   return i;
           }
}


Flipkart End Of Season Sale






© Copyright 2017 Javabychetan.blogspot.com