Bookmark Topic Watch Topic
  • New Topic

static and initialization block

 
vini singh
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 580
Eclipse IDE
  • Mark post as helpful
  • send pies
  • Report post to moderator
Similar question
 
Campbell Ritchie
Sheriff
Pie
Posts: 49796
69
  • Mark post as helpful
  • send pies
  • Report post to moderator
Originally posted by James Tharakan:
Similar question


Agree. Shall close this thread.

Vini Singh: Please read this FAQ, and this one.
 
    Bookmark Topic Watch Topic
  • New Topic