Yes, you can convert an int to a long to avoid overflow. The widening conversion from int to long can preserve the value without causing an overflow.