If you have in Java for example:
void methodA(int i) { ... }
void wrapperMethodArg1() { methodA(1); }
wrapperMethodArg1();
when you call the second method, will the JVM eventually do two or one method calls?
If you have in Java for example:
void methodA(int i) { ... }
void wrapperMethodArg1() { methodA(1); }
wrapperMethodArg1();
when you call the second method, will the JVM eventually do two or one method calls?
You are talking about inlining of method wrapperMethodArg1
.
The answer is: You cannot tell in advance. The compiler will probably not inline it as this prevents reflection invocation, but the JVM might do it dynamically at runtime if the method is called often enough to be optimized.