Results 1 to 6 of 6
  1. #1
    b4viral is offline Member
    Join Date
    Jul 2012
    Posts
    17
    Rep Power
    0

    Post use of code blocks in java

    Hi all,

    as we use constructor in Java to initialize variables, what exactly is the use of static and instance code blocks in java?
    please also give some example which would help me understand this funda.

    Thanking in advance

    Regards,
    vj

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,236
    Rep Power
    19

    Default Re: use of code blocks in java

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    b4viral is offline Member
    Join Date
    Jul 2012
    Posts
    17
    Rep Power
    0

    Default Re: use of code blocks in java

    Hi db,

    the link you provided is helpful getting info regarding, what are code blocks and when they will get executed.

    i have gone thru the same, what i actually wanted was a practical explanation where can it be used?

    please guide,

    Regards,
    vj

  4. #4
    sehudson's Avatar
    sehudson is offline Senior Member
    Join Date
    Mar 2010
    Posts
    356
    Rep Power
    5

    Default Re: use of code blocks in java

    What do you mean exactly when you say 'code block'? Are you referring to methods, such as:

    Java Code:
    public void doWork()
    {
    //execute some code
    }

  5. #5
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,403
    Rep Power
    25

    Default Re: use of code blocks in java

    If you don't understand my response, don't ignore it, ask a question.

  6. #6
    b4viral is offline Member
    Join Date
    Jul 2012
    Posts
    17
    Rep Power
    0

Similar Threads

  1. Jbutton blocks Keylistener
    By Coold0wn in forum New To Java
    Replies: 7
    Last Post: 09-05-2011, 04:32 AM
  2. App that blocks selected web pages.
    By lolaika in forum Advanced Java
    Replies: 3
    Last Post: 06-11-2010, 04:43 PM
  3. Java Blocks??
    By abimaran in forum New To Java
    Replies: 24
    Last Post: 11-07-2009, 03:22 PM
  4. Blocks Language 0.1
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 09-22-2007, 11:21 PM
  5. Task Blocks 0.5
    By johnt in forum Java Software
    Replies: 0
    Last Post: 08-08-2007, 08:43 PM

Tags for this Thread

Posting Permissions

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