Mrsduncanxoxo3188 Mrsduncanxoxo3188
  • 09-01-2020
  • Computers and Technology
contestada

Which of the following variable declarations is a correct assignment?

A. int x = 97.2;
B. char c = 65.5;
C. String w = 82.4;
D. double y = 82;
E. String i = 82;

Respuesta :

teobguan2019
teobguan2019 teobguan2019
  • 10-01-2020

Answer:

Option D: double y = 82;

Explanation:

In Java programming, it is acceptable to assign an integer (lower type) to a double type (higher type) variable. By assigning an integer to double type variable using the "=" operator, the integer will be converted to double type implicitly. It is known as the implicit type casting.  

For example, double y = 82 will convert integer 82 (integer) to 82.0 (double).

Answer Link

Otras preguntas

Use estimate to check for reasonableness of 25 cent plus 4 cent
Square is 19 yd.² what is the length of each side
Solve the following equations : 2(x -1) + 3(x +1)=4(x+4)
Find the vertical asymptotes, if any, of the graph of the rational function. f(x) = x - 4 / x (x - 4) A. x = 4 and x = 4 B. x = 4 C. x = 0 D. no
What is the gcf of 18 and 20 with 18/24 in simplest form
Al is taller than Bob, and Bob is taller than Carl. Which property would you use to prove that Al is taller than Carl? Transitive property Symmetric Property
Whats 13/16,5/48/0.25,0.5 in order least to greatest?
ARE and JW comment on here to win and 4-5= what is the answer
Which are required of a thesis statement for an informative essay? Check all that apply. including a viewpoint or opinion holding together all the ideas setting
whats 8x4i really need help please