Menu
Question Index
...

What will be the output of the following program?

public class Precedence {
    public static void main(String[] args) {
        int x = 20;
        int y = 10;
        double z = x + y * 7 + y-- + x;
        System.out.println(z);
    }
}


120.0
530.0
1110.0
Some other output
Compilation Error or Runtime Error

Doubts

Problems

Topic: Java Operator Precedence And Associativity

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App