The implementation of clone for java object references uses the clone method of the Object class. The reading of its description in the java help page is strongly recommended.
执行Java对象引用的克隆使用Object类的clone方法。强烈建议在java帮助页阅读其描述。
举例----------Examples----------
# we can run this example only if AWT is enabled[我们可以运行这个例子中,只有AWT启用]
if (!nzchar(Sys.getenv("NOAWT"))) {
p1 <- .jnew("java/awt/Point" )
p2 <- clone( p1 )
p2$move( 10L, 10L )
p1$getX()
# check that p1 and p2 are not references to the same java object[检查P1和P2是不相同的Java对象的引用]
stopifnot( p1$getX() == 0 )
stopifnot( p2$getX() == 10 )
}