Programmer Question
Example 1:
SomeObject someObject = new SomeObject();
if (someObject.Method())
{
//do stuff
}
//someObject is never used again
vs
Example 2:
if (new SomeObject().Method())
{
//do stuff
}
Is there any benefit to using the first method over the second, or vice versa?
Find the answer here
No comments:
Post a Comment