adplus-dvertising
frame-decoration

Question

Predict the output of the following program.
class CSE {
    public static void main(String[] args)
    {
        Double object = new Double("2.4");
        int a = object.intValue();
        byte b = object.byteValue();
        float d = object.floatValue();
        double c = object.doubleValue();
        System.out.println(a + b + c + d );
 
    }
}

a.

8

b.

8.8

c.

8.800000095

d.

8

Posted under Java Programming

Answer: (c).8.800000095

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Predict the output of the following program.
Rohit : June 26, 2023

Solve 164 question stepwise

Similar Questions

Discover Related MCQs

Q. Which of the following are legal lines of Java code?

1. int w = (int)888.8;
2. byte x = (byte)100L;
3. long y = (byte)100;
4. byte z = (byte)100L;

Q. Which of the following are legal lines of Java code?

1. int w = (int)888.8;
2. byte x = (byte)100L;
3. long y = (byte)100;
4. byte z = (byte)100L;

Q. Which of these coding types is used for data type characters in Java?

Q. Java array is a collection of ________.

Q. Array data access using _____.

Q. At time of array initialization which is necessary to specify?

Q. Java Array can allocate __________.

Q. Which of the following is an incorrect array declaration?

Q. Index in array start with ______.

Q. Which of the following is used to declare,construct, and initlaize an array?

Q. We can calculate the length of an array using ________.

Q. Which of the following is advantage of java array?

Q. In java, array elements are stored in ________ memory locations.

Q. What does a Data Type in Java refers to?

Q. Choose the wrong statement about Java programming?

Q. Which data type among the following is an implementation of Objects or OOPs?

Q. What is a Primitive Data Type in Java?

Q. Which among the following is not a Data Type in Java?

Q. Which among the following is not a valid Data Type in Java?

Q. Which is the data type used mostly to handle streams and buffers in Java language?