Using variable or using direct method call
- From: - <nobody@xxxxxxxx>
- Date: Tue, 31 May 2005 12:26:20 +0800
If I were to do this:
public void method() {
Container parent = getParent(); :::
::::::
parent.callMethod(...);
:::
::: :::
:::parent.callAnotherMethod(...);
::: ::: }
and if another thread were to change the parent, will the above fail since the method is not synchronized?
Or should I just leave it that way rather than change it to getParent().callMethod(...) everytime...but doing so is of no use since if the parent changes midway, the method's objective will not be met since it requires that the parent be the same throughout the method's scope?
.
- Follow-Ups:
- Re: Using variable or using direct method call
- From: Johan Poppe
- Re: Using variable or using direct method call
- From: P.Hill
- Re: Using variable or using direct method call
- Prev by Date: Re: How to see if an object is part of a specific vector?
- Next by Date: Re: 2's complement
- Previous by thread: Small confusion about negative lookbehind
- Next by thread: Re: Using variable or using direct method call
- Index(es):
Relevant Pages
|
|