Question: Number numberRef = new Integer ( 0 ) ; Double doubleRef = ( Double ) numberRef; Which of the following statements is correct? Group of

Number numberRef = new Integer(0); Double doubleRef =(Double)numberRef;
Which of the following statements is correct?
Group of answer choices
The program runs fine, since Integer is a subclass of Double.
There is no such class named Integer. You should use the class Int.
You can convert an int to double, so you can cast an Integer instance to a Double instance.
A runtime class casting exception occurs, since numberRef is not an instance of Double.
The compiler detects that numberRef is not an instance of Double.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!