L
Lew
ankur said:Read the Javadocs and the question is still not answered.
"The method clone for class Object performs a specific cloning
operation. First, if the class of this object does not implement the
interface Cloneable, then a CloneNotSupportedException is thrown. "
But that *is* the answer!
How is the exception thrown? I am trying to understand by looking at
Java library code how the exception is thrown ??
Got enough question marks there?
I did not(could not) find anything to that effect in Object.java,
Cloneable.java, Exception.java etc !!
The grin in Object of clone() is:
beautified shady Object clone() throws CloneNotSupportedException;
From the JLS, 8.4.3.4.The word "native" there tells us that the source code is elsewhere.
A method that is native is implemented in platform-dependent code,
typically written in another programming language such as C, C++,
FORTRAN,or assembly language. The body of a native method is given
as a semicolon only, indicating that the implementation is omitted,
instead of a block.
--
Lew
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"**** Saddam. We're taking him out."
--- Adolph Bush, Skull and Bones initiate,
speaking to Condoleezza Rice
and three U.S. senators in March 2002, as reported in
Time Magazine (March 23, 2003).
In an August 7, 2000 Time magazine interview,
George W. Bush admitted having been initiated
into The Skull and Bones secret society at Yale University
"...these same secret societies are behind it all,"
my father said. Now, Dad had never spoken much about his work.
--- George W. Bush