Suppose, I have a method with a parameter of Object type.
The method returns nothing - void.
First it checks whether the parameter is not null (or any other check, like objectParam.isEnabled())
if (objectParam.isEnabled()) {
// ok
}
Now, if the condition is satisfied, I need local variables. If it's not, then I don't need any variables.
WHERE SHOULD I define them? Inside the "if scope" or just after the method header?
Of course, I can do it wherever I like, but which way should be a better practice?