바꾸고자 하는 형(to)이 기존의 형(from)보다 넓은 데이터를 담을 수 있는 자료형일 경우 특별한 처리 없이 형을 변환

제목 없는 데이터베이스

int a = 36;
double b = a;     // int to double

short c = 17;
long d = c;       // short to long

float e = 3.14f;
double f = e;     // float to double

타입 캐스팅 (Type Casting)

int a = 3;
double b = (double) a;
long c = (long) a;
double pi = 3.14;
int myInt = (int) pi; // 데이터 손실 (소수 부분)
int a = 9, b = 5;
System.out.println((double) a / b); // 1.8