Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

static and initialization block

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 580
Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Similar question
 
Marshal
Posts: 80279
432
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic