In some code I see this:
private void compute(Long a, Long b, Long c) {
long result = a-(b+c);
...
>
The answer for your doubt is
its makes this conversion a.longValue()-(b.longValue()+c.longValue()) Which means even before your statement performs addition the compiler provides the primitives of long type as input to your operands Remember that this goes in hand as JAVA is statically and strongly typed language.
Hence you get long type output
I hope i cleared your doubt