-2

I know Cloneable is a marker interface and using it has pros and cons, but I want to know:

  1. What is memory strategy of JVM for Cloneable class?

1 Answers1

1

There is no "memory strategy" for cloneable classes, and they don't need more memory than other non-cloneable classes.


I am not entirely sure what you mean by "memory strategy" or "integrated memory". But it is moot, because the JVM treats cloneable classes no different from other classes.

The only thing different about cloneable classes is that the clone() method uses a back door mechanism to create the cloned object that avoids calling constructors in the normal way. But that has no impact on the way that memory is managed.


1) Java adds housekeeping information to reference type in memory. Is there any extra information for cloneable class?

No.

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216