Menu
Topics Index
...
`

ATMTransaction


If you need explanation Read this topic

If you need Answer Take test on this topic

ATMTransaction
What will be the output of the following program?
public class ATMTransaction {
    public static void main(String[] args) {
        int x;
        Double y;
        y = 10000;
        x = 9585;
        if (x % 5 == 0 && (y - x) >= .5)
            y = y - x - .50;
        System.out.println("Remaining = " + y);
    }
}

A. Remaining = 9585.0
B. Remaining = 9584.5
C. Remaining = 415.0
D. Remaining = 414.5
E. Compilation Error or Runtime Error
Topic: Java Double Class And Java Float Class

If you need explanation Read this topic

If you need Answer Take test on this topic

User comments below. All of them might not be correct.

answer is e :bcoz v r assignin int to an object of double without creating an object of it.

Posted by Pramod Jain    2013-05-30 12:39:16


ans is e:u cannot assign integer to Double object

Posted by Santosh Munugota    2013-05-30 12:42:58


ans is e:it can be type casted into double

Posted by Ramya Badisa    2013-05-30 12:49:41


option e...coz.. error: incompatible types..Double is a wrappr class where as int is primitive data type

Posted by Ethan Hunt    2013-05-30 13:12:08


Congratulations Pramod Jain. You are daily dose winner. Please send us your mobile details and we will process the recharge after considering the new likes.

Posted by Merit Campus    2013-05-31 03:42:40


got RC :) :) thank u :)

Posted by Pramod Jain    2013-06-04 16:36:47


© meritcampus 2019

All Rights Reserved.

Open In App