On Fri, 15 Oct 1999, Robert Simmons wrote:
>
> - Original Message -
> From: Gordon Keith <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Cc: Robert Simmons <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Wednesday, October 13,
>
>
> Such is the problem there are times where I dont want the user to be able
> to alter a returned object's state.
>
Thats easy just add a lock variable that take the ( Caller) as a prameter to
set.
Or its not public.
Check that on each method invoction which effects state.
I'm not sure of
- Original Message -
From: Gordon Keith <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: Robert Simmons <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, October 13, 1999 8:36 PM
Subject: Re: Const in java
> [EMAIL PROTECTED] wrote:
> >
> &
On Thu, 14 Oct 1999 09:26:32 -0500 (CDT), Alex M. wrote:
>So there is no added benefit to declaring a parameter final other than to
>allow access from inner classes within the method.
Well, that is one benefit. But the other benefit is a code maintainance
and readability issue.
By saying that
OK, last one, and then maybe we should take this "offline" because it
is not a Java linux question...
A "final" parameter is REQUIRED by the compiler if the variable is
referred to by an inner class.
All local variables must be declared final when referred to by inner
class definitions. This i
So there is no added benefit to declaring a parameter final other than to
allow access from inner classes within the method.
On Thu, 14 Oct 1999, Vartan Piroumian wrote:
> Hi folks,
>
> All parameters are ALWAYS passed by value in Java.
>
> When the parameter being passed is an object referenc
Hi folks,
All parameters are ALWAYS passed by value in Java.
When the parameter being passed is an object reference it is the
VALUE OF THE REFERENCE that is passed by value, not the object being
referenced.
This may seem like a moot distinction, but it is not. A method cannot
destroy the ref
[EMAIL PROTECTED] wrote:
>
> On Wed, 13 Oct 1999, Robert Simmons wrote:
>
> > Since everything in java is passed by reference this becomes even more of an issue.
> > Therefore can I do the following to achieve the desired safety ?
>
> Well, everything is not passed by reference in Java. I beli
[EMAIL PROTECTED] wrote:
> On Wed, 13 Oct 1999, Robert Simmons wrote:
>
> > Since everything in java is passed by reference this becomes even more of an issue.
> > Therefore can I do the following to achieve the desired safety ?
>
> Well, everything is not passed by reference in Java. I believe
Robert,
Since most of your questions are general Java questions and have
nothing to do with the Linux port of the JDK, can you please direct
them elsewhere? The USENET group comp.lang.java.programmer is probably
a good place to ask.
Thank you,
Matt Welsh, UC Berkeley
"Robert Simmons" <[EMAIL P
t Simmons" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Subject: Const in java
>Date: Wed, 13 Oct 1999 15:54:26 -0600
>
>I was always the real proponent of type and instance safety in c++. for
>example.
>
>class Foo {
> private BarClass _bar;
>
>
On Wed, 13 Oct 1999, Robert Simmons wrote:
> Since everything in java is passed by reference this becomes even more of an issue.
> Therefore can I do the following to achieve the desired safety ?
Well, everything is not passed by reference in Java. I believe primitives
and immutable types are
I was always the real proponent of type and instance safety in
c++. for example.
class Foo {
private BarClass
_bar;
public const BarClass&
getBar();
public setBar(const BarClass const
&bar);
}
This snippet guarantees that someone doesnt pull a getBar()
then set the return resu
13 matches
Mail list logo