jQuery in Action, 2nd edition*
The moose likes Beginning Java and the fly likes instance block is called first or constructior called first in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "instance block is called first or constructior called first in java" Watch "instance block is called first or constructior called first in java" New topic
Author

instance block is called first or constructior called first in java

Ramakrishna Gummadi
Greenhorn

Joined: Jun 29, 2011
Posts: 16
instance block is called first or constructor is called first in java
Sandeep Kumar B
Ranch Hand

Joined: Jul 10, 2011
Posts: 41
Instance block
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19725
    
  20

Which you could have tried yourself by simply implementing it.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Ramakrishna Gummadi
Greenhorn

Joined: Jun 29, 2011
Posts: 16
Sandeep Kumar B wrote:Instance block

I mean is instance block called first or constructor called first ?

actually i heared dat.. if a instance block and constructor in a class... then while we creating object to that class.. constructor wil called. now before constructor execution, constructor wil call and execute the instance block, then constructor executes... is this right >?
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39478
    
  28
Go through the Java™ Language Specification index and look for "order" with ctrl-F. This is one of the hits, which I hope you will find useful. If not, try again with ctrl-F "order"
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: instance block is called first or constructior called first in java