Converting from int to long

Take a look at this code:

int yourInt=5;
long yourLong=(long) yourInt;
println(yourLong);

You can generally convert all number types into each other that way.
I hope this helps!

1 Like