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();

Respuesta :

Answer:

Double eleventh = 11.50;

David_Tennant = eleventh.intValue();

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.

ACCESS MORE