• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Placement of static init block - Coding Conventions

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 11606
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
reply
    Bookmark Topic Watch Topic
  • New Topic