Whole or decimal
You've seen several different primitive types for numerical values.
Can you choose the correct one?
Este ejercicio forma parte del curso
Introduction to Java
Instrucciones del ejercicio
- Choose the correct primitive type for the
dressPrice
variable. - Choose the correct primitive type for the
shoePrice
variable.
Ejercicio interactivo práctico
Prueba este ejercicio completando el código de muestra.
class WholeOrDecimal {
public static void main(String[] args) {
byte dressSize = 8;
float shoeSize = 11.5F;
// Choose the correct primitive type
____ dressPrice = 55;
____ shoePrice = 49.9;
}
}