Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

250
Vistas
Would a double to int type conversion be considered implicit type conversion?

Let's say I converted double x to an int, which can be done automatically through truncation. Would this be considered implicit conversion still? Is implicit conversion not being able to translate the actual value from one type to another type without losing any accuracy to that value. In this case would I not be losing the decimal part to x's value? I could not find anything specific in the java docs about this, so I thought to ask here:

double x = 420.69;
int y = x;
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

That is not an implicit conversion and this will result to compiler error.

double x = 420.69;
int y = x;

Since double is a bigger data type than int, it needs to be down-casted.

double x = 420.69;
int y = (int)x;

However,all the digits after the decimal will be lost.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda