If the two types are compatible, then Java will perform the conversion automatically. For example, assign an int value to a long variable.For incompatible types we must use a cast. Casting is an explicit conversion between incompatible types.