[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Suggestion for java/lang/Object
From: |
John Leuner |
Subject: |
Suggestion for java/lang/Object |
Date: |
Tue, 01 May 2001 22:39:29 +0000 |
User-agent: |
Mutt/1.3.15i |
> Edgar> When trying to access the CVS repository I get
> Edgar> connect to subversions.gnu.org:2401 failed: Connection refused
>
> I saw this on another list too. I'm guessing it was a transient
> problem. Can you try again and see?
It works for me now.
This is a suggestion for the doc for the clone() method.
I sometimes wonder whether these docs shouldn't also contain example snippets
for beginner programmers, are we following the Sun approach to documenting
these methods?
John Leuner
Index: java/lang/Object.java
===================================================================
RCS file: /cvs/classpath/java/lang/Object.java,v
retrieving revision 1.7
diff -u -r1.7 Object.java
--- java/lang/Object.java 2000/03/16 23:31:35 1.7
+++ java/lang/Object.java 2001/05/01 22:31:44
@@ -134,7 +134,13 @@
** Object's implementation of clone allocates space for
** the new Object using the correct class, and then fills
** in all of the new field values with the old field
- ** values. Thus, it is a shallow copy.
+ ** values. Thus, it is a shallow copy.<p>
+ **
+ ** All arrays are Cloneable (they all implement the interface
Cloneable).<p>
+ **
+ ** Cloning an array is equivalent to creating a new array of the same
type and size
+ ** and then calling arraycopy. When a multidimensional array (like
int[][] or
+ ** Object[][]) is cloned, only the first dimension is copied. <p>
**
** @exception CloneNotSupportedException
** @return a copy of the Object.
--
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Suggestion for java/lang/Object,
John Leuner <=