Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Placement of static init block - Coding Conventions

 
Roy Pozarelli
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've got the coding conventions "Java Code Conventions" September 12, 1997. What is not explicit is where to place the static initialization block. Do I place this after "Class (static) variables" and before the "Instance variables"? Or after the "Instance variables" and before "Constructors"? Just don't want to lose "stupid" points on the submission.
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didn't use any static initialization blocks in my assignment, but I would suggest after defining the class variables. And don't forget that the order of these blocks do matter, because the order determines the execution order of these blocks when the class is loaded for the very 1st time (as you already knew of course).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic