Menu
Topics Index
...
`

Movies Are Fun


If you need explanation Read this topic

If you need Answer Take test on this topic

Movies Are Fun
What lines fail to compile?
public class MoviesAreFun {

    public static void main(String[] args) {
        int arya2 = 2; /* LINE A */
        double life_is_beautiful = 3.0; /* LINE B */
        char 7/gbrundavan_colony = 'G'; /* LINE C */
        float LIFE_OF_PI = 3.14; /* LINE D */
        short 3idiots = 255; /* LINE E */
    }
}

A. ABCE
B. CE
C. CDE
D. ABCDE
Topic: Java Variables

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.

ans is C...variable name can't start with a number..and in line D,double value can't be assigned to a float variable without typecasting

Posted by Soumya Tata    2013-10-24 04:05:30


variable name can't start with numbers.. so ans is B....

Posted by Ankit Mudiraj    2013-10-24 05:07:31


b is answer...as in line B it should not starts with a number and in line E as well.....it doesn't consists the range of short..

Posted by Racha Rajesh    2013-10-24 08:10:11


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

Posted by Merit Campus    2013-10-25 10:28:29


Any decimal literals like 3.0, 3.14 are by default considered as double. If we want them to be treated as floats, we need to use 3.0f or 3.14f.

Posted by Merit Campus    2013-10-25 10:35:59


© meritcampus 2019

All Rights Reserved.

Open In App