Java-Operator Associativity (Right to Left)

Operator associativity (Right to Left)

The assignment(=) operators are also typically ‘right to left’ associative.

Program


Program Source

public class Javaapp {
    
    public static void main(String[] args) {

        int a,b,c,d;
        a=b=c=d=10;
        System.out.println("a = "+a);
        System.out.println("b = "+b);
        System.out.println("c = "+c);
        System.out.println("d = "+d);
    }
}

Leave a Comment