Menu
Topics Index
...
`

Lemon


If you need explanation Read this topic

If you need Answer Take test on this topic

Lemon
What will be the output of the following program?
public class Lemon {

    public static void main(String[] args) {
        long l = 22;
        int e = l + 3;
        boolean m = l < e;
        float o = 12.5f;
        double n = o * 2;
        System.out.println(l + "e" + m + "o" + n);
    }
}

A. 22etrueo25.0
B. 2225true12.525.0
C. Some other output
D. Compilation Error
Topic: Type Casting In Java

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.

long is assigned to int it leads to compilation error so ans is D

Posted by Sangeetha Ptl    2014-05-01 12:37:32


ans is d bcz e=l+3,here l value (long) is assigned to int instead it could be e=(int)l+3

Posted by Pooja Singh    2014-05-01 12:46:06


Ans is A...l value is 22,since l is less than e ,m is true and n value is 25.0..So the answer is 22etrueo25.0

Posted by Badam Swathi    2014-05-01 12:46:13


Congratulations Sangeetha Ptl. You are this dose winner. We will send you the link using which you can claim your recharge.

Posted by Merit Campus    2014-05-02 04:14:13


© meritcampus 2019

All Rights Reserved.

Open In App