If you are trying to clone an object in java and are getting the below compilation error –
Then the reason why you are getting the above compiler error is that you have not followed either 1 or both of the basic required steps for cloning an object in Java, which are –
- STEP 1 – The class of the object being cloned should implement
- STEP 2 – The class should override
Once you implement the above 2 steps in the class of the object being cloned then the compiler error will stop appearing.