Menu
Question Index
...

What will be the output of the following program.

class MyClass
{
    public static void main(String s[])
    {
        int a = 34;
        double d = 20.5;

        d+=a;
        a+=d;
        d-=a;
        a-=d;

        System.out.println(" d = " + ++d );
        System.out.println(" a = " + a-- );
        
    }
}


Program does not compile
None of the answers
d = -32.5
a = 121
d = 20.5
a = 34

Doubts

Problems

Topic: Arithmetic Compound Assignment Operators In Java

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App