aspose file tools*
The moose likes Beginning Java and the fly likes static and initialization block Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic
Author

static and initialization block

vini singh
Greenhorn

Joined: Dec 04, 2008
Posts: 18
class Bird
{System.out.println("b1");
public Bird(){System.out.println("b2");
}
class Raptor extends Bird
{
static{System.out.println("r1");}
public Raptor(){System.out.println("r2");}
{System.out.println("r3");}
static{System.out.println("r4");}
}

class Hawk extends Raptor
{
public static void main(String s[])
{
System.out.println("pre");
new Hawk();
System.out.println("hawk");
}
}

can you please tell me when exaclty is the class loaded in the memory and after which statement
James Tharakan
Ranch Hand

Joined: Aug 29, 2008
Posts: 580

Similar question


SCJP 6
Why to worry about things in which we dont have control, Why to worry about things in which we have control ! !
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39845
    
  28
Originally posted by James Tharakan:
Similar question


Agree. Shall close this thread.

Vini Singh: Please read this FAQ, and this one.
 
Don't get me started about those stupid light bulbs.
 
subject: static and initialization block