Kava for GCJ?

C. van Reeuwijk C.vanReeuwijk@its.tudelft.nl
Sat Jul 5 09:03:00 GMT 2003


> 
> "C. van Reeuwijk" <C.vanReeuwijk@its.tudelft.nl> writes:
> > unboxing? Instead of annotating a class as 'by value', and placing
> > restrictions on it, why not let the compiler itself discover classes
> > with these restrictions?
> 
> Because treating a class as 'by value' alters the semantics of
> 
>   Thing a = new Thing();
>   Thing b = a;

Only if there is some way to detect the difference.  That's one of the
reasons there are often restrictions on `by value' classes. For example,
in James Gosling's proposal there are the following restrictions:

- All fields must be 'final'
- class variables may not be compared to each other

Under these restrictions your example code has the same visible effect
for reference and value classes.

-- 
Kees van Reeuwijk, Delft University of Technology
http://www.pds.twi.tudelft.nl/~reeuwijk



More information about the Java mailing list