N
N Erlich
Hi all,
I understand the concept of static fields and members
inside a class and the fact that static members belong to
the class rather than to an instance of the class.
I also understand that each class that calls a static
member of another class takes a copy of that member into
its own thread and therefor it's safe to call a static
member concurrency wise.
I have 3 questions though:
1. Are my above understandings correct?
2. when is it unsafe to call/use static members in a class
3. when should one use static members and when shouldn't
he?
Any info would be greatly appreciated!
I understand the concept of static fields and members
inside a class and the fact that static members belong to
the class rather than to an instance of the class.
I also understand that each class that calls a static
member of another class takes a copy of that member into
its own thread and therefor it's safe to call a static
member concurrency wise.
I have 3 questions though:
1. Are my above understandings correct?
2. when is it unsafe to call/use static members in a class
3. when should one use static members and when shouldn't
he?
Any info would be greatly appreciated!