explain "instant member"

  • Thread starter Thread starter MagicKat
  • Start date Start date
Can you explain what they mean by "instant member" for instance, in
the article about arraylists, it says it's thread safe but it's
instant members are not. What does that mean?

http://msdn2.microsoft.com/en-us/library/system.collections.arraylist.
aspx

It's not "instant" (as in "immediate"), it's "instance", meaning you need
to have an (instance of an) object to access that method.
See the "Add" method (and most of the other methods for ArrayList)

The opposite is "static" (I think it's "Shared" in VB) where you don't need
an instance. See the "ReadOnly" method and a couple of others.

Hans Kestin
 
MagicKat said:
Can you explain what they mean by "instant member" for instance, in the
article about arraylists, it says it's thread safe but it's instant
members are not. What does that mean?

http://msdn2.microsoft.com/en-us/library/system.collections.arraylist.aspx
The term you refer to is "instance member". The caution in the cited
article, "Any instance members are not guaranteed to be thread safe", refers
to the fact that you can create an ArrayList to hold any "type", and that
you need to refer to the class definition for a given type to determine if
that type is thread safe.
 
It isn't "instant" members, it is "instance" members.

Instance members are members that are not shared (static).

So if the method is not shared/static, it is not thread safe.
 
Back
Top