Reputation: 921
In courses of Android Basics on Udacity, (View view) and (View v) were used interchangeably.
public void methodName(View view){}
public void methodName2(View v){}
Are they the same? I'm curious because one might act a little different than the other and they are changing the view to v to view again for a specific purpose.
Upvotes: 1
Views: 1012
Reputation: 502
both view and v are just variables name. they will both act the same. you can also write methodName3(View name) and "name" will still act the same as "view" and "v".
Upvotes: 3
Reputation: 181390
Yes. They are exactly the same. The only difference is that parameter formal names are different: v
and view
. Use whatever you like and makes your code more readable.
Upvotes: 5