+ 2

Method variable passing naming conventions

Is it bad practice to use the same name of the variable you are passing as the variable a method receives?

23rd Dec 2018, 4:56 AM
Cole Deane
Cole Deane - avatar
2 Respostas
+ 5
In my opinion, it is easier for us to recheck our code. static int sum(int x){ return x+10; } int x=4; System.out.print(sum(x) ); //Output 14 we will not become confuse
23rd Dec 2018, 1:42 PM
Muhd Khairul Amirin
Muhd Khairul Amirin - avatar
0
I don't know
23rd Dec 2018, 9:25 PM
nurettin tepeli
nurettin tepeli - avatar