Menu
Topics Index
...
`

Formating the given number1695


If you need explanation Read this topic

If you need Answer Take test on this topic

Formating the given number1695
What is the output of the following program?
public class Arrangement {
    public static void main(String[] args) {
        int in = 12345;
        boolean bol = true;
        System.out.format("%d", in);
        System.out.format("%d", bol);
    }
}

A. 12345
true
B. 12345
1
C. 12345
D. Compilation Error
E. Runtime Error
Topic: Java Formatter

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.

D

Posted by Vinod Kumar M    2013-08-22 04:36:30


answer is e  runtime error ...the number 12345 wil get printed but coming to bol we get runtime error as boolean value can't be formatted to integer value...

Posted by Archana Reddy    2013-08-22 04:45:04


Ans is compilation error bczz boolean value can't be changed to integer....

Posted by Racha Rajesh    2013-08-22 05:07:55


Congratulations Archana Reddy. You are this dose winner. Please send us your mobile details in a private message and we will process the recharge asap.

Posted by Merit Campus    2013-08-23 08:00:04


thanq Merit Campus... I got my rc.... :)

Posted by Archana Reddy    2013-08-24 06:04:14


© meritcampus 2019

All Rights Reserved.

Open In App