object - Java Static Method Calling -


is calling static java method ( factory class method ) creates object of class ?

i mean static method returns value let's array's size ( array variable of class )

i've checked code couldn't see object of class never instantiated before calling static method. ?

public static boolean isfiveinstance() {     return _instances.size() == 5; } 

and _instances class variable

private static arraylist<localmediaplayer> _instances; 

and being created , filled in constructer.

no, static invocations not instantiated objects (because not require one).

the first time refer class, including static method invocation, class loaded. classloader.

that's static initializer comes play:

static {      // } 

this block called whenever class initialized (once per classloader)


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -