+ 6
I have a question about function argument.
What's the difference between funcA and funcB ? void funcA(int a){ System.out.print(a); } void funcB(int b){ int input = b; System.out.print(input); } Do I need to declare a new variable for argument ? Or I just can use the argument directly ? Which is better ?
2 Respuestas
+ 3
@Kuanlin Chen, yes, I believe it is for the sake of efficiency. You can of course create variables in a function if it is necessary, but in the case on your sample code it was not necessary.
+ 5
Is it because of efficiency ?