This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Java in General and the fly likes block with out identifier Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "block with out identifier" Watch "block with out identifier" New topic
Author

block with out identifier

saikrishna cinux
Ranch Hand

Joined: Apr 16, 2005
Posts: 689
hi to all



why init is displayed before Const??

what is that block called there is no identifier

can any please explain me

thanking you in advance


regards
cinux


A = HARDWORK B = LUCK/FATE If C=(A+B) then C=SUCCESSFUL IN LIFE else C=FAILURE IN LIFE
SCJP 1.4
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14672
    
  11

This is called "Instance initializers" and is executed before constructors.


[My Blog]
All roads lead to JavaRanch
Jesper de Jong
Java Cowboy
Bartender

Joined: Aug 16, 2005
Posts: 12911
    
    3

The following article explains it all:

Object initialization in Java - The full story of object initialization in the Java language and virtual machine


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: block with out identifier
 
Similar Threads
Initialization Blocks
Static Blocks
Block (not static)in a class...??
instance init block concept
what wrong with my code?