Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Jon Lee
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!