Tuesday, 17 May 2011

Naming Convention : Name for return value in method

Some people find it nice to name "return value" of the method as "result". So for eg. :

public String myMethod()
{
...// do something
String result = ...
...//do something
return result;
}


So in this way, when someone reads the method, he is clear what "result" is, and how it is being processed.

No comments:

Post a Comment