Link to home
Start Free TrialLog in
Avatar of bent27
bent27

asked on

convert Long to int

is there a way to convert 'Long'  to int ?
Avatar of wellhole
wellhole

Typecast it

int x = (int) y;
ASKER CERTIFIED SOLUTION
Avatar of Aanvik
Aanvik

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You don't really want to convert a long to a int because it loses true value. The only time you would want to cast is when the the other object can hold more data then the previous.