Results 1 to 3 of 3
  1. #1
    rdehankar is offline Member
    Join Date
    Mar 2014
    Posts
    1
    Rep Power
    0

    Post Static Block in java executes first

    why Static Block in java executes first than the main block?
    what is specific reason??

  2. #2
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,050
    Rep Power
    6

    Default Re: Static Block in java executes first

    Isn't it more useful to you to ask what static initializer blocks are used for? Apparently you don't understand that, or else you wouldn't have to ask this question.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  3. #3
    jashburn is offline Senior Member
    Join Date
    Feb 2014
    Posts
    219
    Rep Power
    1

Similar Threads

  1. What is the use of Static method and static block
    By chandrasekhar.melam in forum New To Java
    Replies: 7
    Last Post: 08-20-2013, 02:44 PM
  2. Replies: 16
    Last Post: 08-09-2013, 12:02 PM
  3. Static Block and variable problem
    By phobosforever in forum New To Java
    Replies: 1
    Last Post: 07-04-2011, 01:28 PM
  4. Catthing errors when java executes
    By jchristiansen70 in forum New To Java
    Replies: 3
    Last Post: 09-07-2010, 10:45 PM
  5. [SOLVED] static block or constructor?
    By JT4NK3D in forum New To Java
    Replies: 3
    Last Post: 05-27-2008, 02:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •