211k views
1 vote
Consider that the following variables have been declared: int David_Tennant; double Matt_Smith; Which of the following statements are valid. Select all that apply.

a. Integer tenth = David_Tennant;
b. (double)David_Tennant = Matt_Smith;
c. Matt_Smith = double(David_Tennant;)
d. Matt_Smith = (double)David_Tennant;
e. Matt_Smith = David_Tennant;



Double eleventh = 11.50;
David_Tennant = eleventh.intValue();

1 Answer

5 votes

Answer:

Double eleventh = 11.50;

David_Tennant = eleventh.intValue();

Step-by-step explanation:

These two statements are correct. Method intValue() converts Integer to int which is is called unboxing. In this case intValue() method converting Integert part of eleventh variable then storing it in int variable David_Tennant. Output will be 11.

User Czarina
by
6.3k points