Well, you can't do that because initialize() returns void (of course). For that to work, initialize() would have to return an instance of A. This would be kind of silly, as the instance wouldn't be used; furthermore, many IDEs would warn about the usage.

It's never occurred to be as a general rule before, but it's obvious that in fact static method calls can't be chained together.

Peter Primrose
Ranch Hand

Joined: Sep 10, 2004
Posts: 755

posted Jun 30, 2006 16:31:00

0

RIGHT!!!

ok...I can do this: private all methods and have one method public as: