What is object cloning?
Share
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Please Disable the AdBlocker to Continue to the site.
The process of making an exact duplicate of an object is known as object cloning in Java. In essence, it refers to the capability to produce an object that is in a state that is similar to the original object. Java provides a method called clone() that can be used to accomplish this. This function generates a new instance of the class of the current object and initialises all of its fields with exactly the same contents as the relevant fields.