This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Where is the implementation of clone() method of Object Class?? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Where is the implementation of clone() method of Object Class??" Watch "Where is the implementation of clone() method of Object Class??" New topic
Author

Where is the implementation of clone() method of Object Class??

Jon Lee
Ranch Hand

Joined: Mar 04, 2005
Posts: 134
In the source file Object.java, I only see the following code


Where can I see the implementation code of this method? Or it just can not be seen??

Pls give me a clue, thnx a lot!


SCJP 5.0 - 98% (2007)<br />SCWCD 1.4 - 97% (2007)
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
The keyword "native" means that the implementation is NOT in Java. I would guess it's written in C or C++. As for the answer to your question, I'm not sure where you find the implementation. Perhaps look for an Object.c or Object.cpp file in the source distribution? I've never looked at the source myself, so that's only a guess. I've never worked with native methods, either, so I'm not entirely sure about the details about how the Java source interacts with the native source in C/C++.

Sorry I can't be much more help.

Layne
[ May 08, 2005: Message edited by: Layne Lund ]

Java API Documentation
The Java Tutorial
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Where is the implementation of clone() method of Object Class??
 
Similar Threads
Clone method giving error
Question regarding Cloneable interface and Subclasses
Array clone
Object cast in Prototype pattern
why only clone method and finalize method in object class are protected?