I would hope you don't use an initialiser nor a constructor to print output to the screen. You might use print statements for debugging but printing output usually belongs inside methods rather than initialisers.
John Pacuta wrote:. . . how I would do that using an instance initialization block and with a constructor and then explain the difference. . . .
What is the point to them? If you are going to initialise a field to a default value every time, it is possible to do that in the constructor, or with a declaration‑and‑initialisation combined. There are also possible problems about order of execution with initialisers, which I read about in Java Puzzlers by Bloch and Gafter, but I have forgotten the details.
Mike. J. Thompson wrote:. . . Out of interest, why don't you like instance initializer blocks Campbell?
Good point. I know Winston G would agree with you there.
Mike. J. Thompson wrote:Personally I would say to leave the final modifiers there . . .
Sachin Tripathi wrote:1-Put the code separetly in all constructors
Sachin Tripathi wrote:2-Put it into a method...