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

A science test, which is worth 100 points, consists of 24 questions. Each question is worth either 3 points or 5 points. If x is the number of 3-point questions
How is perimeter measured
Angie, a student in an advanced statistics course, was given an algebra test and she scored 80%. Is this an accurate predictor of how well students in the algeb
the perimeter and area of each figure: a. A square with a side length of 3.5 inches.
HELPP MEE PLEASE and if u do I will answer one of urs
This graph shows a change in population over how many years?
live fund is selling their holdings
Poison dart frogs live in the rainforest. They produce a poison by eating toxic fire ants. The only known predator is a snake, Liophis epinephelus. Which of the
Given SiO2 + 4HF --> SiF4 +2H2O in this chemical equation how many grams of HF are needed for 182 grams of SiO2 to react completely?
Select the equivalent forms. 50% = 10% = 75% =
good job