Java Game Developer Question:
Download Questions PDF

What is the concept of object cloning and how is this used in java?

Java Game Developer Interview Question
Java Game Developer Interview Question

Answer:

There are times when one needs to use the exact copy of an object for a specific purpose, without changing the actual object in any way. The option, in this case, is to create another similar object, which will require a greater amount of memory to be expensed, and this is where the construct of object cloning provided by java comes to prove beneficial.
The clone() methods of the object class implement the concept of object cloning but require the implementation of the java.lang.A cloneable interface of the object class whose clone you are trying to create. Devoid of this, a CloneNotSupportedException is generated by the clone() method of the class.

Download Java Game Developer Interview Questions And Answers PDF

Previous QuestionNext Question
Explain me the Advantages And Disadvantages Of Using Packed Buffers?Explain is There A Centralized Database Of Game Names And Ids?