What is the difference between the codes below?
Alternative 1:
QuickAction quickAction = new QuickAction();
quickAction.changeFormField();
Alternative 2:
new QuickAction().changeFormField();
I think the Alternative 1
is better if I call only a single method, because it don't use a new memory address to the variable. If I call 2 or more methods, I can create a variable and assign the new object. Is it correct?