I know that implicit casting is done automatically by the compiler and virtual machine, and that explicit casting is needed to convert types of data when Java is not sure if the result will be valid. Casting should be done between primitives or between objects.
My question is: If my application uses both integers as well as long integers - should I use long
for both types? Or downcasting for long
? Or casting for int
?
Can usage of long for both types causes some problems?