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
Post a Comment