object shared

  • Thread starter Thread starter Eduardo Azevedo
  • Start date Start date
E

Eduardo Azevedo

If I have a class with method Shared, when this objects are destroies what's
happend with the objects Shared?

How long is the lifetime of a function shared in the Class ?

there are no instantiate

thks

Eduardo R Azevedo
 
Shared objects, properties and methods don't sit on the stack like
instantiated ones. They remain in the heap, regardless of the instantiationn
of objects that they belong to. For example, you can have 20 instances of an
object with a shared property. All 20 instances will share the same property
value for that property because the property doesn't sit on the stack with
the rest of the instantiated class; it remains in the heap. The lifetime of
Shared objects is the life of the application.

--
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Back
Top