Ask Question

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

+2
Answers (1)
  1. 4 December, 09:43
    0
    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.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Consider that the following variables have been declared: int David_Tennant; double Matt_Smith; Which of the following statements are ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers