06 Java Type Casting Basics - Primitive Data Types - Narrowing + Widening

Описание к видео 06 Java Type Casting Basics - Primitive Data Types - Narrowing + Widening

int x = 10;
double y;
y = x; //Widening casting no need to do anything
System.out.println(x);
System.out.println(y);

double k = 324324324.45357;
short c = (short) k; //Narrowing casting manually
System.out.println(k);
System.out.println(c);

Комментарии

Информация по комментариям в разработке