Re: How is tag interface functionality implemented in Java continued ...?
- From: Arne Vajhøj <arne@xxxxxxxxxx>
- Date: Sun, 07 Sep 2008 22:52:01 -0400
ankur wrote:
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. "
How is the exception thrown? I am trying to understand by looking at
Java library code how the exception is thrown ??
I did not(could not) find anything to that effect in Object.java,
Cloneable.java, Exception.java etc !!
First of all: Java is a standard. I very much doubt that the
Java standard specifies how it should be implemented. The
java docs document the contract for all Java implementations.
Second: if we narrow the question to SUN's Java implementation,
then you need to look at the provided source code. If you are
interested in the behavior of Object.clone, then you find
that method in the source. When you do that then you
will see that it is a native method, which tells you that
the exception is thrown from some C code. If you want to
see that C code you should grab a copy of the open source
version of SUN Java (OpenJDK) and find the code. But
there are really not much point - the important part
is described above under "first".
Arne
.
- References:
- Prev by Date: Re: How is tag interface functionality implemented in Java continued ...?
- Next by Date: Re: Why JDBC cannot be used to select column types for all SQL server
- Previous by thread: Re: How is tag interface functionality implemented in Java continued ...?
- Next by thread: Re: How is tag interface functionality implemented in Java continued ...?
- Index(es):
Relevant Pages
|