LifeSpan of a Static variable

  • Thread starter Thread starter Jack Wright
  • Start date Start date
J

Jack Wright

Dear All,
I have declare a static object of my class in a WebService. What is
the life span of this Object? Will GC clean it up if it is not used or
accessed? Or Will the worker process keep it alive till it gets
recycled?

Please help

TALIA

Many Regards
Jack
 
Hi Jack:

The static will be around for the duration of your application. The GC
will not touch a reference your application can still reach and use.

HTH,
 
Back
Top