CSS font stacks & developer FAQs with Web standards
Site navigation below

One of hundreds of answers available with our premium content service.

Part answer

A: Using a dot separator to call a method on a new instance is a convenience technique that combines two statements in one. There is no practical difference in the method invocation, in both cases a new instance is created and the method is executed, but in practice the code can create unnecessary anonymous instances and confuse the assignment of the return value. For clarity it is better to use two separate statements with obvious assignments, as the series of examples below illustrate.

… full answer hidden

Click for full answers

Premium members click below for full answer
Is it OK to tag inline method calls on constructors?

Home · Web fonts · Font stacks · FAQs · Java · CSS · Javascript · HTML · Site manager