Have a very simple question here. Is there any way that I can convert below arguments to longs?
I want the absolute difference between the two different arguments but I end up with "java: integer number too large" error.
The problem, I guess, is that literals are always interpreted as integers. I thought recasting them as longs in the Diff() method would suffice?
Is there any way to concatenate/append the "L" (which converts integers to longs) to parameters?
I've been scratching my head for a while now... :/
public class Difference {
public static void main(String[] args) {
Diff(10,12);
Diff(71293781758123,72784);
Diff(1,12345677654321);
Diff(1,2147483647);
}
public static Long Diff(long a, long b) {
return Math.abs(a - b);
}
}